module Clang.FFI
(
Index
,createIndex
,TranslationUnit
,ClientData
,UnsavedFile
,AvailabilityKind(..)
,CXString
,getCString
,File
,getFileName
,getFileTime
,getFile
,SourceLocation
,getNullLocation
,equalLocations
,getLocation
,getLocationForOffset
,SourceRange
,getNullRange
,getRange
,getInstantiationLocation
,getSpellingLocation
,getRangeStart
,getRangeEnd
,DiagnosticSeverity(..)
,Diagnostic
,getNumDiagnostics
,getDiagnostic
,DiagnosticDisplayOptions(..)
,getDiagnosticDispOptSum
,formatDiagnostic
,defaultDiagnosticDisplayOptions
,getDiagnosticSeverity
,getDiagnosticLocation
,getDiagnosticSpelling
,getDiagnosticOption
,getDiagnosticCategory
,getDiagnosticCategoryName
,getDiagnosticNumRanges
,getDiagnosticRange
,getDiagnosticNumFixIts
,getDiagnosticFixIt
,getTranslationUnitSpelling
,createTranslationUnitFromSourceFile
,createTranslationUnit
,TranslationUnitFlags(..)
,getTranslationUnitFlagsSum
,defaultEditingTranslationUnitOptions
,parseTranslationUnit
,unsavedFileSize
,setCXUnsavedFile
,SaveTranslationUnitFlags(..)
,getSaveTranslationUnitFlagsSum
,defaultSaveOptions
,saveTranslationUnit
,ReparseFlags(..)
,getReparseFlagsSum
,defaultReparseOptions
,reparseTranslationUnit
,CursorKind(..)
,Cursor
,getNullCursor
,getTranslationUnitCursor
,equalCursors
,hashCursor
,getCursorKind
,isDeclaration
,isReference
,isExpression
,isStatement
,isInvalid
,isTranslationUnit
,isPreprocessing
,isUnexposed
,LinkageKind(..)
,getCursorLinkage
,getCursorAvailability
,LanguageKind(..)
,getCursorLanguage
,CursorSet
,createCXCursorSet
,cXCursorSet_contains
,cXCursorSet_insert
,getCursorSemanticParent
,getCursorLexicalParent
,getOverriddenCursors
,getIncludedFile
,getCursor
,getCursorLocation
,getCursorExtent
,TypeKind(..)
,Type
,getTypeKind
,getCursorType
,equalTypes
,getCanonicalType
,isConstQualifiedType
,isVolatileQualifiedType
,isRestrictQualifiedType
,getPointeeType
,getTypeDeclaration
,getDeclObjCTypeEncoding
,getTypeKindSpelling
,getResultType
,getCursorResultType
,isPODType
,isVirtualBase
,CXXAccessSpecifier(..)
,getCXXAccessSpecifier
,getNumOverloadedDecls
,getOverloadedDecl
,getIBOutletCollectionType
,ChildVisitResult(..)
,ChildVisitor
,visitChildren
,getCursorUSR
,constructUSR_ObjCClass
,constructUSR_ObjCCategory
,constructUSR_ObjCProtocol
,constructUSR_ObjCIvar
,constructUSR_ObjCMethod
,constructUSR_ObjCProperty
,getCursorSpelling
,getCursorDisplayName
,getCursorReferenced
,getCursorDefinition
,isCursorDefinition
,getCanonicalCursor
,cXXMethod_isStatic
,getTemplateCursorKind
,getSpecializedCursorTemplate
,TokenKind(..)
,Token
,getTokenKind
,getTokenSpelling
,getTokenLocation
,getTokenExtent
,tokenize
,annotateTokens
,getCursorKindSpelling
,enableStackTraces
,CompletionString
,CompletionResult
,CompletionChunkKind(..)
,getCompletionChunkKind
,getCompletionChunkText
,getCompletionChunkCompletionString
,getNumCompletionChunks
,getCompletionPriority
,getCompletionAvailability
,CodeCompleteFlags(..)
,getCodeCompleteFlagsSum
,defaultCodeCompleteOptions
,CodeCompleteResults
,codeCompleteAt
,sortCodeCompletionResults
,codeCompleteGetNumDiagnostics
,codeCompleteGetDiagnostic
,getClangVersion
,InclusionVisitor
,getInclusions
,wrapInclusionVisitor
) where
import Data.Word
import Control.Applicative((<$>))
import Foreign.GreenCard
import Foreign.C
import Foreign.ForeignPtr
import Foreign.Ptr
import Foreign.Marshal.Utils(new)
import System.IO.Unsafe(unsafePerformIO)
import Data.Maybe(fromJust)
import Control.Monad(when)
import Clang.Alloc
marshall_fptr :: ForeignPtr a -> IO (Ptr a)
marshall_fptr = return . unsafeForeignPtrToPtr
data IndexObj
type Index = Ptr IndexObj
createIndex :: Bool -> Bool -> IO (ForeignPtr IndexObj)
createIndex gc_arg1 gc_arg2 =
(marshall_bool_ gc_arg1) >>= \ (a) ->
(marshall_bool_ gc_arg2) >>= \ (b) ->
prim_createIndex a b
>>= \ r ->
(unmarshall_index r) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_createIndex" prim_createIndex :: Int -> Int -> IO (Ptr r1)
foreign import ccall unsafe "clang-c/Index.h &clang_disposeIndex" clang_disposeIndex :: FunPtr (Ptr IndexObj -> IO ())
unmarshall_index :: Ptr IndexObj -> IO (ForeignPtr IndexObj)
unmarshall_index = newForeignPtr clang_disposeIndex
data TranslationUnitObj
type TranslationUnit = Ptr TranslationUnitObj
foreign import ccall unsafe "clang-c/Index.h &clang_disposeTranslationUnit" clang_disposeTranslationUnitPtr :: FunPtr (Ptr TranslationUnitObj -> IO ())
unmarshall_translationUnit :: Ptr TranslationUnitObj -> IO (ForeignPtr TranslationUnitObj)
unmarshall_translationUnit = newForeignPtr clang_disposeTranslationUnitPtr
data ClientDataObj
type ClientData = ForeignPtr ClientDataObj
data UnsavedFile = UnsavedFile { unsavedFilename :: FilePath, unsavedContents :: String }
data AvailabilityKind
= Availability_Available
| Availability_Deprecated
| Availability_NotAvailable
deriving (Eq)
marshall_AvailabilityKind :: AvailabilityKind -> Int
marshall_AvailabilityKind arg1 =
case arg1 of {
Availability_Available -> availability_Available;
Availability_Deprecated -> availability_Deprecated;
Availability_NotAvailable -> availability_NotAvailable
}
unmarshall_AvailabilityKind :: Int -> AvailabilityKind
unmarshall_AvailabilityKind arg1 =
if arg1 == availability_Available
then Availability_Available
else if arg1 == availability_Deprecated
then Availability_Deprecated
else if arg1 == availability_NotAvailable
then Availability_NotAvailable
else error ("unmarshall_AvailabilityKind: unknown value ("++show arg1++")\n")
availability_Available :: Int
availability_Available =
unsafePerformIO(
prim_availability_Available
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_availability_Available" prim_availability_Available :: IO (Int)
availability_Deprecated :: Int
availability_Deprecated =
unsafePerformIO(
prim_availability_Deprecated
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_availability_Deprecated" prim_availability_Deprecated :: IO (Int)
availability_NotAvailable :: Int
availability_NotAvailable =
unsafePerformIO(
prim_availability_NotAvailable
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_availability_NotAvailable" prim_availability_NotAvailable :: IO (Int)
data StringObj
newtype CXString = CXString (ForeignPtr StringObj)
foreign import ccall unsafe "FFI_stub_ffi.h mkStrObj" mkStrObj :: IO (Ptr StringObj)
foreign import ccall unsafe "FFI_stub_ffi.h &freeStrObj" freeStrObj :: FunPtr (Ptr StringObj -> IO ())
unmarshall_cxString :: Ptr StringObj -> IO CXString
unmarshall_cxString p = CXString <$> (newForeignPtr freeStrObj p)
marshall_cxString :: CXString -> IO (ForeignPtr StringObj)
marshall_cxString (CXString a) = return a
getCString :: CXString -> IO String
getCString gc_arg1 =
(marshall_cxString gc_arg1) >>= \ (gc_arg2) ->
(marshall_fptr gc_arg2) >>= \ (d) ->
prim_getCString d
>>= \ r ->
(unmarshall_string_ r) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCString" prim_getCString :: Ptr a1 -> IO (Ptr r1)
newtype File = File (Ptr ())
getFileName :: File -> IO CXString
getFileName gc_arg1 =
case gc_arg1 of { (File x) ->
prim_getFileName x
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getFileName" prim_getFileName :: Ptr a1 -> IO (Ptr r1)
getFileTime (File ptr) = clang_getFileTime ptr
foreign import ccall unsafe "clang-c/Index.h clang_getFileTime" clang_getFileTime :: Ptr () -> IO CTime
getFile :: TranslationUnit -> String -> IO File
getFile t gc_arg1 =
(marshall_string_ gc_arg1) >>= \ (s) ->
prim_getFile t s
>>= \ r ->
(return ((File r)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getFile" prim_getFile :: Ptr a1 -> Ptr a2 -> IO (Ptr r1)
data SourceLocation = SourceLocation (Ptr ()) (Ptr ()) Int
foreign import ccall safe "FFI_stub_ffi.h srcLocListGetPtr" srcLocListGetPtr_ :: Ptr () -> CInt -> CInt -> IO (Ptr ())
foreign import ccall safe "FFI_stub_ffi.h srcLocListGetData" srcLocListGetData_ :: Ptr () -> CInt -> IO CInt
unmarshall_SrcLocList :: Ptr () -> CUInt -> IO [SourceLocation]
unmarshall_SrcLocList sls 0 = return []
unmarshall_SrcLocList sls nsl = mapM getSrcList_ [0..(nsl1)]
where getSrcList_ i = do
p1 <- srcLocListGetPtr_ sls (fromIntegral i) 0
p2 <- srcLocListGetPtr_ sls (fromIntegral i) 1
i <- fromIntegral <$> srcLocListGetData_ sls (fromIntegral i)
return $ SourceLocation p1 p2 i
data SourceRange = SourceRange (Ptr ()) (Ptr ()) Int Int
getNullLocation :: IO SourceLocation
getNullLocation =
prim_getNullLocation
>>= \ gc_result ->
access_prim_getNullLocation_gc_res1 gc_result >>= \ gc_res1 ->
access_prim_getNullLocation_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getNullLocation_gc_res3 gc_result >>= \ gc_res3 ->
(return ((SourceLocation gc_res1 gc_res2 gc_res3)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getNullLocation" prim_getNullLocation :: IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getNullLocation_gc_res1 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getNullLocation_gc_res2 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getNullLocation_gc_res3 :: Ptr a1 -> IO (Int)
equalLocations :: SourceLocation -> SourceLocation -> IO Bool
equalLocations gc_arg1 gc_arg2 =
case gc_arg1 of { (SourceLocation p1 p2 d) ->
case gc_arg2 of { (SourceLocation p12 p22 d2) ->
prim_equalLocations p1 p2 d p12 p22 d2
>>= \ gc_res2 ->
(unmarshall_bool_ gc_res2) >>= \ gc_res1 ->
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_equalLocations" prim_equalLocations :: Ptr a1 -> Ptr a2 -> Int -> Ptr a4 -> Ptr a5 -> Int -> IO (Int)
getLocation :: TranslationUnit -> File -> Int -> Int -> IO SourceLocation
getLocation t gc_arg1 i j =
case gc_arg1 of { (File f) ->
prim_getLocation t f i j
>>= \ gc_result ->
access_prim_getLocation_gc_res1 gc_result >>= \ gc_res1 ->
access_prim_getLocation_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getLocation_gc_res3 gc_result >>= \ gc_res3 ->
(return ((SourceLocation gc_res1 gc_res2 gc_res3)))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getLocation" prim_getLocation :: Ptr a1 -> Ptr a2 -> Int -> Int -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getLocation_gc_res1 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getLocation_gc_res2 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getLocation_gc_res3 :: Ptr a1 -> IO (Int)
getLocationForOffset :: TranslationUnit -> File -> Int -> IO SourceLocation
getLocationForOffset t gc_arg1 i =
case gc_arg1 of { (File f) ->
prim_getLocationForOffset t f i
>>= \ gc_result ->
access_prim_getLocationForOffset_gc_res1 gc_result >>= \ gc_res1 ->
access_prim_getLocationForOffset_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getLocationForOffset_gc_res3 gc_result >>= \ gc_res3 ->
(return ((SourceLocation gc_res1 gc_res2 gc_res3)))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getLocationForOffset" prim_getLocationForOffset :: Ptr a1 -> Ptr a2 -> Int -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getLocationForOffset_gc_res1 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getLocationForOffset_gc_res2 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getLocationForOffset_gc_res3 :: Ptr a1 -> IO (Int)
getNullRange :: IO SourceRange
getNullRange =
prim_getNullRange
>>= \ gc_result ->
access_prim_getNullRange_gc_res1 gc_result >>= \ gc_res1 ->
access_prim_getNullRange_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getNullRange_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getNullRange_gc_res4 gc_result >>= \ gc_res4 ->
(return ((SourceRange gc_res1 gc_res2 gc_res3 gc_res4)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getNullRange" prim_getNullRange :: IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getNullRange_gc_res1 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getNullRange_gc_res2 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getNullRange_gc_res3 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getNullRange_gc_res4 :: Ptr a1 -> IO (Int)
getRange :: SourceLocation -> SourceLocation -> IO SourceRange
getRange gc_arg1 gc_arg2 =
case gc_arg1 of { (SourceLocation p1 p2 d) ->
case gc_arg2 of { (SourceLocation p12 p22 d2) ->
prim_getRange p1 p2 d p12 p22 d2
>>= \ gc_result ->
access_prim_getRange_gc_res1 gc_result >>= \ gc_res1 ->
access_prim_getRange_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getRange_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getRange_gc_res4 gc_result >>= \ gc_res4 ->
(return ((SourceRange gc_res1 gc_res2 gc_res3 gc_res4)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getRange" prim_getRange :: Ptr a1 -> Ptr a2 -> Int -> Ptr a4 -> Ptr a5 -> Int -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getRange_gc_res1 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getRange_gc_res2 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getRange_gc_res3 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getRange_gc_res4 :: Ptr a1 -> IO (Int)
getInstantiationLocation :: SourceLocation -> IO (File,Int,Int,Int)
getInstantiationLocation gc_arg1 =
case gc_arg1 of { (SourceLocation p1 p2 d) ->
prim_getInstantiationLocation p1 p2 d
>>= \ gc_result ->
access_prim_getInstantiationLocation_f gc_result >>= \ f ->
access_prim_getInstantiationLocation_ln gc_result >>= \ ln ->
access_prim_getInstantiationLocation_c gc_result >>= \ c ->
access_prim_getInstantiationLocation_o gc_result >>= \ o ->
(return (((File f),ln,c,o)))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getInstantiationLocation" prim_getInstantiationLocation :: Ptr a1 -> Ptr a2 -> Int -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getInstantiationLocation_f :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getInstantiationLocation_ln :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getInstantiationLocation_c :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getInstantiationLocation_o :: Ptr a1 -> IO (Int)
getSpellingLocation :: SourceLocation -> IO (File,Int,Int,Int)
getSpellingLocation gc_arg1 =
case gc_arg1 of { (SourceLocation p1 p2 d) ->
prim_getSpellingLocation p1 p2 d
>>= \ gc_result ->
access_prim_getSpellingLocation_f gc_result >>= \ f ->
access_prim_getSpellingLocation_ln gc_result >>= \ ln ->
access_prim_getSpellingLocation_c gc_result >>= \ c ->
access_prim_getSpellingLocation_o gc_result >>= \ o ->
(return (((File f),ln,c,o)))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getSpellingLocation" prim_getSpellingLocation :: Ptr a1 -> Ptr a2 -> Int -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getSpellingLocation_f :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getSpellingLocation_ln :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getSpellingLocation_c :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getSpellingLocation_o :: Ptr a1 -> IO (Int)
getRangeStart :: SourceRange -> IO SourceLocation
getRangeStart gc_arg1 =
case gc_arg1 of { (SourceRange p1 p2 d1 d2) ->
prim_getRangeStart p1 p2 d1 d2
>>= \ gc_result ->
access_prim_getRangeStart_gc_res1 gc_result >>= \ gc_res1 ->
access_prim_getRangeStart_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getRangeStart_gc_res3 gc_result >>= \ gc_res3 ->
(return ((SourceLocation gc_res1 gc_res2 gc_res3)))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getRangeStart" prim_getRangeStart :: Ptr a1 -> Ptr a2 -> Int -> Int -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getRangeStart_gc_res1 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getRangeStart_gc_res2 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getRangeStart_gc_res3 :: Ptr a1 -> IO (Int)
getRangeEnd :: SourceRange -> IO SourceLocation
getRangeEnd gc_arg1 =
case gc_arg1 of { (SourceRange p1 p2 d1 d2) ->
prim_getRangeEnd p1 p2 d1 d2
>>= \ gc_result ->
access_prim_getRangeEnd_gc_res1 gc_result >>= \ gc_res1 ->
access_prim_getRangeEnd_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getRangeEnd_gc_res3 gc_result >>= \ gc_res3 ->
(return ((SourceLocation gc_res1 gc_res2 gc_res3)))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getRangeEnd" prim_getRangeEnd :: Ptr a1 -> Ptr a2 -> Int -> Int -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getRangeEnd_gc_res1 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getRangeEnd_gc_res2 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getRangeEnd_gc_res3 :: Ptr a1 -> IO (Int)
data DiagnosticSeverity
= Diagnostic_Ignored
| Diagnostic_Note
| Diagnostic_Warning
| Diagnostic_Error
| Diagnostic_Fatal
deriving (Eq)
marshall_DiagnosticSeverity :: DiagnosticSeverity -> Int
marshall_DiagnosticSeverity arg1 =
case arg1 of {
Diagnostic_Ignored -> diagnostic_Ignored;
Diagnostic_Note -> diagnostic_Note;
Diagnostic_Warning -> diagnostic_Warning;
Diagnostic_Error -> diagnostic_Error;
Diagnostic_Fatal -> diagnostic_Fatal
}
unmarshall_DiagnosticSeverity :: Int -> DiagnosticSeverity
unmarshall_DiagnosticSeverity arg1 =
if arg1 == diagnostic_Ignored
then Diagnostic_Ignored
else if arg1 == diagnostic_Note
then Diagnostic_Note
else if arg1 == diagnostic_Warning
then Diagnostic_Warning
else if arg1 == diagnostic_Error
then Diagnostic_Error
else if arg1 == diagnostic_Fatal
then Diagnostic_Fatal
else error ("unmarshall_DiagnosticSeverity: unknown value ("++show arg1++")\n")
diagnostic_Ignored :: Int
diagnostic_Ignored =
unsafePerformIO(
prim_diagnostic_Ignored
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_diagnostic_Ignored" prim_diagnostic_Ignored :: IO (Int)
diagnostic_Note :: Int
diagnostic_Note =
unsafePerformIO(
prim_diagnostic_Note
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_diagnostic_Note" prim_diagnostic_Note :: IO (Int)
diagnostic_Warning :: Int
diagnostic_Warning =
unsafePerformIO(
prim_diagnostic_Warning
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_diagnostic_Warning" prim_diagnostic_Warning :: IO (Int)
diagnostic_Error :: Int
diagnostic_Error =
unsafePerformIO(
prim_diagnostic_Error
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_diagnostic_Error" prim_diagnostic_Error :: IO (Int)
diagnostic_Fatal :: Int
diagnostic_Fatal =
unsafePerformIO(
prim_diagnostic_Fatal
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_diagnostic_Fatal" prim_diagnostic_Fatal :: IO (Int)
data DiagnosticObj
type Diagnostic = ForeignPtr DiagnosticObj
foreign import ccall unsafe "clang-c/Index.h &clang_disposeDiagnostic" clang_disposeDiagnostic :: FunPtr (Ptr DiagnosticObj -> IO ())
unmarshall_diag :: Ptr DiagnosticObj -> IO (ForeignPtr DiagnosticObj)
unmarshall_diag = newForeignPtr clang_disposeDiagnostic
getNumDiagnostics :: TranslationUnit -> IO Int
getNumDiagnostics t =
prim_getNumDiagnostics t
>>= \ r ->
(return (r))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getNumDiagnostics" prim_getNumDiagnostics :: Ptr a1 -> IO (Int)
getDiagnostic :: TranslationUnit -> Int -> IO Diagnostic
getDiagnostic t i =
prim_getDiagnostic t i
>>= \ r ->
(unmarshall_diag r) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getDiagnostic" prim_getDiagnostic :: Ptr a1 -> Int -> IO (Ptr r1)
data DiagnosticDisplayOptions
= Diagnostic_DisplaySourceLocation
| Diagnostic_DisplayColumn
| Diagnostic_DisplaySourceRanges
| Diagnostic_DisplayOption
| Diagnostic_DisplayCategoryId
| Diagnostic_DisplayCategoryName
deriving (Eq)
marshall_DiagnosticDisplayOptions :: DiagnosticDisplayOptions -> Int
marshall_DiagnosticDisplayOptions arg1 =
case arg1 of {
Diagnostic_DisplaySourceLocation -> diagnostic_DisplaySourceLocation;
Diagnostic_DisplayColumn -> diagnostic_DisplayColumn;
Diagnostic_DisplaySourceRanges -> diagnostic_DisplaySourceRanges;
Diagnostic_DisplayOption -> diagnostic_DisplayOption;
Diagnostic_DisplayCategoryId -> diagnostic_DisplayCategoryId;
Diagnostic_DisplayCategoryName -> diagnostic_DisplayCategoryName
}
unmarshall_DiagnosticDisplayOptions :: Int -> DiagnosticDisplayOptions
unmarshall_DiagnosticDisplayOptions arg1 =
if arg1 == diagnostic_DisplaySourceLocation
then Diagnostic_DisplaySourceLocation
else if arg1 == diagnostic_DisplayColumn
then Diagnostic_DisplayColumn
else if arg1 == diagnostic_DisplaySourceRanges
then Diagnostic_DisplaySourceRanges
else if arg1 == diagnostic_DisplayOption
then Diagnostic_DisplayOption
else if arg1 == diagnostic_DisplayCategoryId
then Diagnostic_DisplayCategoryId
else if arg1 == diagnostic_DisplayCategoryName
then Diagnostic_DisplayCategoryName
else error ("unmarshall_DiagnosticDisplayOptions: unknown value ("++show arg1++")\n")
diagnostic_DisplaySourceLocation :: Int
diagnostic_DisplaySourceLocation =
unsafePerformIO(
prim_diagnostic_DisplaySourceLocation
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_diagnostic_DisplaySourceLocation" prim_diagnostic_DisplaySourceLocation :: IO (Int)
diagnostic_DisplayColumn :: Int
diagnostic_DisplayColumn =
unsafePerformIO(
prim_diagnostic_DisplayColumn
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_diagnostic_DisplayColumn" prim_diagnostic_DisplayColumn :: IO (Int)
diagnostic_DisplaySourceRanges :: Int
diagnostic_DisplaySourceRanges =
unsafePerformIO(
prim_diagnostic_DisplaySourceRanges
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_diagnostic_DisplaySourceRanges" prim_diagnostic_DisplaySourceRanges :: IO (Int)
diagnostic_DisplayOption :: Int
diagnostic_DisplayOption =
unsafePerformIO(
prim_diagnostic_DisplayOption
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_diagnostic_DisplayOption" prim_diagnostic_DisplayOption :: IO (Int)
diagnostic_DisplayCategoryId :: Int
diagnostic_DisplayCategoryId =
unsafePerformIO(
prim_diagnostic_DisplayCategoryId
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_diagnostic_DisplayCategoryId" prim_diagnostic_DisplayCategoryId :: IO (Int)
diagnostic_DisplayCategoryName :: Int
diagnostic_DisplayCategoryName =
unsafePerformIO(
prim_diagnostic_DisplayCategoryName
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_diagnostic_DisplayCategoryName" prim_diagnostic_DisplayCategoryName :: IO (Int)
getDiagnosticDispOptSum :: [DiagnosticDisplayOptions] -> Int
getDiagnosticDispOptSum = sum . (map toVal_)
where toVal_ Diagnostic_DisplaySourceLocation = 0x1
toVal_ Diagnostic_DisplayColumn = 0x2
toVal_ Diagnostic_DisplaySourceRanges = 0x4
toVal_ Diagnostic_DisplayOption = 0x8
toVal_ Diagnostic_DisplayCategoryId = 0x10
toVal_ Diagnostic_DisplayCategoryName = 0x20
formatDiagnostic :: Diagnostic -> Int -> IO CXString
formatDiagnostic gc_arg1 i =
(marshall_fptr gc_arg1) >>= \ (d) ->
prim_formatDiagnostic d i
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_formatDiagnostic" prim_formatDiagnostic :: Ptr a1 -> Int -> IO (Ptr r1)
defaultDiagnosticDisplayOptions :: IO Int
defaultDiagnosticDisplayOptions =
prim_defaultDiagnosticDisplayOptions
>>= \ res1 ->
(return (res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_defaultDiagnosticDisplayOptions" prim_defaultDiagnosticDisplayOptions :: IO (Int)
getDiagnosticSeverity :: Diagnostic -> IO DiagnosticSeverity
getDiagnosticSeverity gc_arg1 =
(marshall_fptr gc_arg1) >>= \ (arg1) ->
prim_getDiagnosticSeverity arg1
>>= \ res1 ->
let gc_res1 = (unmarshall_DiagnosticSeverity (res1)) in
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getDiagnosticSeverity" prim_getDiagnosticSeverity :: Ptr a1 -> IO (Int)
getDiagnosticLocation :: Diagnostic -> IO SourceLocation
getDiagnosticLocation gc_arg1 =
(marshall_fptr gc_arg1) >>= \ (d) ->
prim_getDiagnosticLocation d
>>= \ gc_result ->
access_prim_getDiagnosticLocation_gc_res1 gc_result >>= \ gc_res1 ->
access_prim_getDiagnosticLocation_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getDiagnosticLocation_gc_res3 gc_result >>= \ gc_res3 ->
(return ((SourceLocation gc_res1 gc_res2 gc_res3)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getDiagnosticLocation" prim_getDiagnosticLocation :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getDiagnosticLocation_gc_res1 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getDiagnosticLocation_gc_res2 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getDiagnosticLocation_gc_res3 :: Ptr a1 -> IO (Int)
getDiagnosticSpelling :: Diagnostic -> IO CXString
getDiagnosticSpelling gc_arg1 =
(marshall_fptr gc_arg1) >>= \ (d) ->
prim_getDiagnosticSpelling d
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getDiagnosticSpelling" prim_getDiagnosticSpelling :: Ptr a1 -> IO (Ptr r1)
getDiagnosticOption :: Diagnostic -> IO (CXString,CXString)
getDiagnosticOption gc_arg1 =
(marshall_fptr gc_arg1) >>= \ (d) ->
prim_getDiagnosticOption d
>>= \ gc_result ->
access_prim_getDiagnosticOption_r gc_result >>= \ r ->
access_prim_getDiagnosticOption_a gc_result >>= \ a ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(unmarshall_cxString a) >>= \ gc_res2 ->
(return ((gc_res1,gc_res2)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getDiagnosticOption" prim_getDiagnosticOption :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getDiagnosticOption_r :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getDiagnosticOption_a :: Ptr a1 -> IO (Ptr r1)
getDiagnosticCategory :: Diagnostic -> IO Int
getDiagnosticCategory gc_arg1 =
(marshall_fptr gc_arg1) >>= \ (arg1) ->
prim_getDiagnosticCategory arg1
>>= \ res1 ->
(return (res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getDiagnosticCategory" prim_getDiagnosticCategory :: Ptr a1 -> IO (Int)
getDiagnosticCategoryName :: Int -> IO CXString
getDiagnosticCategoryName c =
prim_getDiagnosticCategoryName c
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getDiagnosticCategoryName" prim_getDiagnosticCategoryName :: Int -> IO (Ptr r1)
getDiagnosticNumRanges :: Diagnostic -> IO Int
getDiagnosticNumRanges gc_arg1 =
(marshall_fptr gc_arg1) >>= \ (arg1) ->
prim_getDiagnosticNumRanges arg1
>>= \ res1 ->
(return (res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getDiagnosticNumRanges" prim_getDiagnosticNumRanges :: Ptr a1 -> IO (Int)
getDiagnosticRange :: Diagnostic -> Int -> IO SourceRange
getDiagnosticRange gc_arg1 i =
(marshall_fptr gc_arg1) >>= \ (d) ->
prim_getDiagnosticRange d i
>>= \ gc_result ->
access_prim_getDiagnosticRange_gc_res1 gc_result >>= \ gc_res1 ->
access_prim_getDiagnosticRange_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getDiagnosticRange_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getDiagnosticRange_gc_res4 gc_result >>= \ gc_res4 ->
(return ((SourceRange gc_res1 gc_res2 gc_res3 gc_res4)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getDiagnosticRange" prim_getDiagnosticRange :: Ptr a1 -> Int -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getDiagnosticRange_gc_res1 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getDiagnosticRange_gc_res2 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getDiagnosticRange_gc_res3 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getDiagnosticRange_gc_res4 :: Ptr a1 -> IO (Int)
getDiagnosticNumFixIts :: Diagnostic -> IO Int
getDiagnosticNumFixIts gc_arg1 =
(marshall_fptr gc_arg1) >>= \ (arg1) ->
prim_getDiagnosticNumFixIts arg1
>>= \ res1 ->
(return (res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getDiagnosticNumFixIts" prim_getDiagnosticNumFixIts :: Ptr a1 -> IO (Int)
getDiagnosticFixIt :: Diagnostic -> Int -> IO (SourceRange,CXString)
getDiagnosticFixIt gc_arg1 i =
(marshall_fptr gc_arg1) >>= \ (d) ->
prim_getDiagnosticFixIt d i
>>= \ gc_result ->
access_prim_getDiagnosticFixIt_gc_res1 gc_result >>= \ gc_res1 ->
access_prim_getDiagnosticFixIt_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getDiagnosticFixIt_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getDiagnosticFixIt_gc_res4 gc_result >>= \ gc_res4 ->
access_prim_getDiagnosticFixIt_r gc_result >>= \ r ->
(unmarshall_cxString r) >>= \ gc_res5 ->
(return (((SourceRange gc_res1 gc_res2 gc_res3 gc_res4),gc_res5)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getDiagnosticFixIt" prim_getDiagnosticFixIt :: Ptr a1 -> Int -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getDiagnosticFixIt_gc_res1 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getDiagnosticFixIt_gc_res2 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getDiagnosticFixIt_gc_res3 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getDiagnosticFixIt_gc_res4 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getDiagnosticFixIt_r :: Ptr a1 -> IO (Ptr r1)
getTranslationUnitSpelling :: TranslationUnit -> IO CXString
getTranslationUnitSpelling t =
prim_getTranslationUnitSpelling t
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getTranslationUnitSpelling" prim_getTranslationUnitSpelling :: Ptr a1 -> IO (Ptr r1)
createTranslationUnitFromSourceFile :: Index -> String -> [String] -> [UnsavedFile] -> IO (ForeignPtr TranslationUnitObj)
createTranslationUnitFromSourceFile i gc_arg1 gc_arg2 gc_arg5 =
(marshall_string_ gc_arg1) >>= \ (s) ->
(marshall_listLenString gc_arg2) >>= \ (gc_arg3) ->
case gc_arg3 of { (gc_arg4,ns) ->
(marshall_fptr gc_arg4) >>= \ (ss) ->
(marshall_listLenUnsavedFile gc_arg5) >>= \ (gc_arg6) ->
case gc_arg6 of { (gc_arg7,nufs) ->
(marshall_fptr gc_arg7) >>= \ (ufs) ->
prim_createTranslationUnitFromSourceFile i s ss ns ufs nufs
>>= \ r ->
(unmarshall_translationUnit r) >>= \ gc_res1 ->
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_createTranslationUnitFromSourceFile" prim_createTranslationUnitFromSourceFile :: Ptr a1 -> Ptr a2 -> Ptr a3 -> Int -> Ptr a5 -> Int -> IO (Ptr r1)
createTranslationUnit :: Index -> String -> IO (ForeignPtr TranslationUnitObj)
createTranslationUnit i gc_arg1 =
(marshall_string_ gc_arg1) >>= \ (s) ->
prim_createTranslationUnit i s
>>= \ r ->
(unmarshall_translationUnit r) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_createTranslationUnit" prim_createTranslationUnit :: Ptr a1 -> Ptr a2 -> IO (Ptr r1)
data TranslationUnitFlags
= TranslationUnit_None
| TranslationUnit_DetailedPreprocessingRecord
| TranslationUnit_Incomplete
| TranslationUnit_PrecompiledPreamble
| TranslationUnit_CacheCompletionResults
| TranslationUnit_CXXPrecompiledPreamble
| TranslationUnit_CXXChainedPCH
deriving (Eq)
marshall_TranslationUnitFlags :: TranslationUnitFlags -> Int
marshall_TranslationUnitFlags arg1 =
case arg1 of {
TranslationUnit_None -> translationUnit_None;
TranslationUnit_DetailedPreprocessingRecord -> translationUnit_DetailedPreprocessingRecord;
TranslationUnit_Incomplete -> translationUnit_Incomplete;
TranslationUnit_PrecompiledPreamble -> translationUnit_PrecompiledPreamble;
TranslationUnit_CacheCompletionResults -> translationUnit_CacheCompletionResults;
TranslationUnit_CXXPrecompiledPreamble -> translationUnit_CXXPrecompiledPreamble;
TranslationUnit_CXXChainedPCH -> translationUnit_CXXChainedPCH
}
unmarshall_TranslationUnitFlags :: Int -> TranslationUnitFlags
unmarshall_TranslationUnitFlags arg1 =
if arg1 == translationUnit_None
then TranslationUnit_None
else if arg1 == translationUnit_DetailedPreprocessingRecord
then TranslationUnit_DetailedPreprocessingRecord
else if arg1 == translationUnit_Incomplete
then TranslationUnit_Incomplete
else if arg1 == translationUnit_PrecompiledPreamble
then TranslationUnit_PrecompiledPreamble
else if arg1 == translationUnit_CacheCompletionResults
then TranslationUnit_CacheCompletionResults
else if arg1 == translationUnit_CXXPrecompiledPreamble
then TranslationUnit_CXXPrecompiledPreamble
else if arg1 == translationUnit_CXXChainedPCH
then TranslationUnit_CXXChainedPCH
else error ("unmarshall_TranslationUnitFlags: unknown value ("++show arg1++")\n")
translationUnit_None :: Int
translationUnit_None =
unsafePerformIO(
prim_translationUnit_None
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_translationUnit_None" prim_translationUnit_None :: IO (Int)
translationUnit_DetailedPreprocessingRecord :: Int
translationUnit_DetailedPreprocessingRecord =
unsafePerformIO(
prim_translationUnit_DetailedPreprocessingRecord
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_translationUnit_DetailedPreprocessingRecord" prim_translationUnit_DetailedPreprocessingRecord :: IO (Int)
translationUnit_Incomplete :: Int
translationUnit_Incomplete =
unsafePerformIO(
prim_translationUnit_Incomplete
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_translationUnit_Incomplete" prim_translationUnit_Incomplete :: IO (Int)
translationUnit_PrecompiledPreamble :: Int
translationUnit_PrecompiledPreamble =
unsafePerformIO(
prim_translationUnit_PrecompiledPreamble
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_translationUnit_PrecompiledPreamble" prim_translationUnit_PrecompiledPreamble :: IO (Int)
translationUnit_CacheCompletionResults :: Int
translationUnit_CacheCompletionResults =
unsafePerformIO(
prim_translationUnit_CacheCompletionResults
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_translationUnit_CacheCompletionResults" prim_translationUnit_CacheCompletionResults :: IO (Int)
translationUnit_CXXPrecompiledPreamble :: Int
translationUnit_CXXPrecompiledPreamble =
unsafePerformIO(
prim_translationUnit_CXXPrecompiledPreamble
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_translationUnit_CXXPrecompiledPreamble" prim_translationUnit_CXXPrecompiledPreamble :: IO (Int)
translationUnit_CXXChainedPCH :: Int
translationUnit_CXXChainedPCH =
unsafePerformIO(
prim_translationUnit_CXXChainedPCH
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_translationUnit_CXXChainedPCH" prim_translationUnit_CXXChainedPCH :: IO (Int)
getTranslationUnitFlagsSum :: [TranslationUnitFlags] -> Int
getTranslationUnitFlagsSum = sum . (map toVal_)
where toVal_ TranslationUnit_None = 0x0
toVal_ TranslationUnit_DetailedPreprocessingRecord = 0x01
toVal_ TranslationUnit_Incomplete = 0x02
toVal_ TranslationUnit_PrecompiledPreamble = 0x04
toVal_ TranslationUnit_CacheCompletionResults = 0x08
toVal_ TranslationUnit_CXXPrecompiledPreamble = 0x10
toVal_ TranslationUnit_CXXChainedPCH = 0x20
defaultEditingTranslationUnitOptions :: IO Int
defaultEditingTranslationUnitOptions =
prim_defaultEditingTranslationUnitOptions
>>= \ res1 ->
(return (res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_defaultEditingTranslationUnitOptions" prim_defaultEditingTranslationUnitOptions :: IO (Int)
parseTranslationUnit :: Index -> Maybe String -> [String] -> [UnsavedFile] -> Int -> IO (Maybe (ForeignPtr TranslationUnitObj))
parseTranslationUnit i gc_arg1 gc_arg2 gc_arg5 i2 =
(case gc_arg1 of {
Nothing -> (return (nullPtr));
(Just gc_arg1) -> (marshall_string_ gc_arg1) >>= \ (s) ->
(return ((s)))
}) >>= \ (s) ->
(marshall_listLenString gc_arg2) >>= \ (gc_arg3) ->
case gc_arg3 of { (gc_arg4,ns) ->
(marshall_fptr gc_arg4) >>= \ (ss) ->
(marshall_listLenUnsavedFile gc_arg5) >>= \ (gc_arg6) ->
case gc_arg6 of { (gc_arg7,nufs) ->
(marshall_fptr gc_arg7) >>= \ (ufs) ->
prim_parseTranslationUnit i s ss ns ufs nufs i2
>>= \ r ->
(if nullPtr == (r)
then return Nothing
else (unmarshall_translationUnit r) >>= \ gc_res2 ->
(return ((Just gc_res2)))) >>= \ gc_res1 ->
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_parseTranslationUnit" prim_parseTranslationUnit :: Ptr a1 -> Ptr a2 -> Ptr a3 -> Int -> Ptr a5 -> Int -> Int -> IO (Ptr r1)
marshall_listLenString :: [String] -> IO (ForeignPtr CString, Int)
marshall_listLenString [] = do
arr <- newForeignPtr finalizerFree nullPtr
return (arr, 0)
marshall_listLenString ss = do
let numStrs = length ss
arr_ <- mallocArray numStrs :: IO (Ptr CString)
cstrs <- mapM newCString ss
pokeArray arr_ cstrs
arr <- newForeignPtr finalizerFree arr_
return (arr, numStrs)
foreign import ccall unsafe "FFI_stub_ffi.h unsavedFileSize" unsavedFileSize :: Word32
foreign import ccall unsafe "FFI_stub_ffi.h setCXUnsavedFile" setCXUnsavedFile :: CString -> CString -> CULong -> Ptr () -> CInt -> IO ()
marshall_listLenUnsavedFile :: [UnsavedFile] -> IO (ForeignPtr (), Int)
marshall_listLenUnsavedFile [] = do
arr <- newForeignPtr finalizerFree nullPtr
return (arr, 0)
marshall_listLenUnsavedFile ufs = do
let numUFs = length ufs
ufsDataSize :: Int
ufsDataSize = fromIntegral unsavedFileSize
arr_ <- mallocBytes (numUFs * ufsDataSize) :: IO (Ptr ())
let setUF (i, uf) = do
fname <- newCString $ unsavedFilename uf
contents <- newCString $ unsavedContents uf
let len = (fromIntegral . length) (unsavedContents uf) :: CULong
setCXUnsavedFile fname contents len arr_ (fromIntegral i)
mapM_ setUF (zip [0..(numUFs1)] ufs)
arr <- newForeignPtr finalizerFree arr_
return (arr, numUFs)
data SaveTranslationUnitFlags
= SaveTranslationUnit_None
deriving (Eq)
marshall_SaveTranslationUnitFlags :: SaveTranslationUnitFlags -> Int
marshall_SaveTranslationUnitFlags arg1 =
case arg1 of { SaveTranslationUnit_None -> saveTranslationUnit_None
}
unmarshall_SaveTranslationUnitFlags :: Int -> SaveTranslationUnitFlags
unmarshall_SaveTranslationUnitFlags arg1 =
if arg1 == saveTranslationUnit_None
then SaveTranslationUnit_None
else error ("unmarshall_SaveTranslationUnitFlags: unknown value ("++show arg1++")\n")
saveTranslationUnit_None :: Int
saveTranslationUnit_None =
unsafePerformIO(
prim_saveTranslationUnit_None
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_saveTranslationUnit_None" prim_saveTranslationUnit_None :: IO (Int)
getSaveTranslationUnitFlagsSum :: [SaveTranslationUnitFlags] -> Int
getSaveTranslationUnitFlagsSum = sum . (map toVal_)
where toVal_ SaveTranslationUnit_None = 0
defaultSaveOptions :: TranslationUnit -> IO Int
defaultSaveOptions t =
prim_defaultSaveOptions t
>>= \ r ->
(return (r))
foreign import ccall unsafe "FFI_stub_ffi.h prim_defaultSaveOptions" prim_defaultSaveOptions :: Ptr a1 -> IO (Int)
saveTranslationUnit :: TranslationUnit -> String -> Int -> IO Bool
saveTranslationUnit t gc_arg1 i =
(marshall_string_ gc_arg1) >>= \ (s) ->
prim_saveTranslationUnit t s i
>>= \ gc_res2 ->
(unmarshall_bool_ gc_res2) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_saveTranslationUnit" prim_saveTranslationUnit :: Ptr a1 -> Ptr a2 -> Int -> IO (Int)
data ReparseFlags
= Reparse_None
deriving (Eq)
marshall_ReparseFlags :: ReparseFlags -> Int
marshall_ReparseFlags arg1 =
case arg1 of { Reparse_None -> reparse_None
}
unmarshall_ReparseFlags :: Int -> ReparseFlags
unmarshall_ReparseFlags arg1 =
if arg1 == reparse_None
then Reparse_None
else error ("unmarshall_ReparseFlags: unknown value ("++show arg1++")\n")
reparse_None :: Int
reparse_None =
unsafePerformIO(
prim_reparse_None
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_reparse_None" prim_reparse_None :: IO (Int)
getReparseFlagsSum :: [ReparseFlags] -> Int
getReparseFlagsSum = sum . (map toVal_)
where toVal_ Reparse_None = 0
defaultReparseOptions :: TranslationUnit -> IO Int
defaultReparseOptions t =
prim_defaultReparseOptions t
>>= \ r ->
(return (r))
foreign import ccall unsafe "FFI_stub_ffi.h prim_defaultReparseOptions" prim_defaultReparseOptions :: Ptr a1 -> IO (Int)
reparseTranslationUnit :: TranslationUnit -> [UnsavedFile] -> Int -> IO Bool
reparseTranslationUnit t gc_arg1 i =
(marshall_listLenUnsavedFile gc_arg1) >>= \ (gc_arg2) ->
case gc_arg2 of { (gc_arg3,nufs) ->
(marshall_fptr gc_arg3) >>= \ (ufs) ->
prim_reparseTranslationUnit t ufs nufs i
>>= \ r ->
(unmarshall_bool_ r) >>= \ gc_res1 ->
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_reparseTranslationUnit" prim_reparseTranslationUnit :: Ptr a1 -> Ptr a2 -> Int -> Int -> IO (Int)
data CursorKind
= Cursor_UnexposedDecl
| Cursor_StructDecl
| Cursor_UnionDecl
| Cursor_ClassDecl
| Cursor_EnumDecl
| Cursor_FieldDecl
| Cursor_EnumConstantDecl
| Cursor_FunctionDecl
| Cursor_VarDecl
| Cursor_ParmDecl
| Cursor_ObjCInterfaceDecl
| Cursor_ObjCCategoryDecl
| Cursor_ObjCProtocolDecl
| Cursor_ObjCPropertyDecl
| Cursor_ObjCIvarDecl
| Cursor_ObjCInstanceMethodDecl
| Cursor_ObjCClassMethodDecl
| Cursor_ObjCImplementationDecl
| Cursor_ObjCCategoryImplDecl
| Cursor_TypedefDecl
| Cursor_CXXMethod
| Cursor_Namespace
| Cursor_LinkageSpec
| Cursor_Constructor
| Cursor_Destructor
| Cursor_ConversionFunction
| Cursor_TemplateTypeParameter
| Cursor_NonTypeTemplateParameter
| Cursor_TemplateTemplateParameter
| Cursor_FunctionTemplate
| Cursor_ClassTemplate
| Cursor_ClassTemplatePartialSpecialization
| Cursor_NamespaceAlias
| Cursor_UsingDirective
| Cursor_UsingDeclaration
| Cursor_FirstDecl
| Cursor_LastDecl
| Cursor_FirstRef
| Cursor_ObjCSuperClassRef
| Cursor_ObjCProtocolRef
| Cursor_ObjCClassRef
| Cursor_TypeRef
| Cursor_CXXBaseSpecifier
| Cursor_TemplateRef
| Cursor_NamespaceRef
| Cursor_MemberRef
| Cursor_LabelRef
| Cursor_OverloadedDeclRef
| Cursor_LastRef
| Cursor_FirstInvalid
| Cursor_InvalidFile
| Cursor_NoDeclFound
| Cursor_NotImplemented
| Cursor_InvalidCode
| Cursor_LastInvalid
| Cursor_FirstExpr
| Cursor_UnexposedExpr
| Cursor_DeclRefExpr
| Cursor_MemberRefExpr
| Cursor_CallExpr
| Cursor_ObjCMessageExpr
| Cursor_BlockExpr
| Cursor_LastExpr
| Cursor_FirstStmt
| Cursor_UnexposedStmt
| Cursor_LabelStmt
| Cursor_LastStmt
| Cursor_TranslationUnit
| Cursor_FirstAttr
| Cursor_UnexposedAttr
| Cursor_IBActionAttr
| Cursor_IBOutletAttr
| Cursor_IBOutletCollectionAttr
| Cursor_LastAttr
| Cursor_PreprocessingDirective
| Cursor_MacroDefinition
| Cursor_MacroInstantiation
| Cursor_InclusionDirective
| Cursor_FirstPreprocessing
| Cursor_LastPreprocessing
deriving (Eq)
marshall_CursorKind :: CursorKind -> Int
marshall_CursorKind arg1 =
case arg1 of {
Cursor_UnexposedDecl -> cursor_UnexposedDecl;
Cursor_StructDecl -> cursor_StructDecl;
Cursor_UnionDecl -> cursor_UnionDecl;
Cursor_ClassDecl -> cursor_ClassDecl;
Cursor_EnumDecl -> cursor_EnumDecl;
Cursor_FieldDecl -> cursor_FieldDecl;
Cursor_EnumConstantDecl -> cursor_EnumConstantDecl;
Cursor_FunctionDecl -> cursor_FunctionDecl;
Cursor_VarDecl -> cursor_VarDecl;
Cursor_ParmDecl -> cursor_ParmDecl;
Cursor_ObjCInterfaceDecl -> cursor_ObjCInterfaceDecl;
Cursor_ObjCCategoryDecl -> cursor_ObjCCategoryDecl;
Cursor_ObjCProtocolDecl -> cursor_ObjCProtocolDecl;
Cursor_ObjCPropertyDecl -> cursor_ObjCPropertyDecl;
Cursor_ObjCIvarDecl -> cursor_ObjCIvarDecl;
Cursor_ObjCInstanceMethodDecl -> cursor_ObjCInstanceMethodDecl;
Cursor_ObjCClassMethodDecl -> cursor_ObjCClassMethodDecl;
Cursor_ObjCImplementationDecl -> cursor_ObjCImplementationDecl;
Cursor_ObjCCategoryImplDecl -> cursor_ObjCCategoryImplDecl;
Cursor_TypedefDecl -> cursor_TypedefDecl;
Cursor_CXXMethod -> cursor_CXXMethod;
Cursor_Namespace -> cursor_Namespace;
Cursor_LinkageSpec -> cursor_LinkageSpec;
Cursor_Constructor -> cursor_Constructor;
Cursor_Destructor -> cursor_Destructor;
Cursor_ConversionFunction -> cursor_ConversionFunction;
Cursor_TemplateTypeParameter -> cursor_TemplateTypeParameter;
Cursor_NonTypeTemplateParameter -> cursor_NonTypeTemplateParameter;
Cursor_TemplateTemplateParameter -> cursor_TemplateTemplateParameter;
Cursor_FunctionTemplate -> cursor_FunctionTemplate;
Cursor_ClassTemplate -> cursor_ClassTemplate;
Cursor_ClassTemplatePartialSpecialization -> cursor_ClassTemplatePartialSpecialization;
Cursor_NamespaceAlias -> cursor_NamespaceAlias;
Cursor_UsingDirective -> cursor_UsingDirective;
Cursor_UsingDeclaration -> cursor_UsingDeclaration;
Cursor_FirstDecl -> cursor_FirstDecl;
Cursor_LastDecl -> cursor_LastDecl;
Cursor_FirstRef -> cursor_FirstRef;
Cursor_ObjCSuperClassRef -> cursor_ObjCSuperClassRef;
Cursor_ObjCProtocolRef -> cursor_ObjCProtocolRef;
Cursor_ObjCClassRef -> cursor_ObjCClassRef;
Cursor_TypeRef -> cursor_TypeRef;
Cursor_CXXBaseSpecifier -> cursor_CXXBaseSpecifier;
Cursor_TemplateRef -> cursor_TemplateRef;
Cursor_NamespaceRef -> cursor_NamespaceRef;
Cursor_MemberRef -> cursor_MemberRef;
Cursor_LabelRef -> cursor_LabelRef;
Cursor_OverloadedDeclRef -> cursor_OverloadedDeclRef;
Cursor_LastRef -> cursor_LastRef;
Cursor_FirstInvalid -> cursor_FirstInvalid;
Cursor_InvalidFile -> cursor_InvalidFile;
Cursor_NoDeclFound -> cursor_NoDeclFound;
Cursor_NotImplemented -> cursor_NotImplemented;
Cursor_InvalidCode -> cursor_InvalidCode;
Cursor_LastInvalid -> cursor_LastInvalid;
Cursor_FirstExpr -> cursor_FirstExpr;
Cursor_UnexposedExpr -> cursor_UnexposedExpr;
Cursor_DeclRefExpr -> cursor_DeclRefExpr;
Cursor_MemberRefExpr -> cursor_MemberRefExpr;
Cursor_CallExpr -> cursor_CallExpr;
Cursor_ObjCMessageExpr -> cursor_ObjCMessageExpr;
Cursor_BlockExpr -> cursor_BlockExpr;
Cursor_LastExpr -> cursor_LastExpr;
Cursor_FirstStmt -> cursor_FirstStmt;
Cursor_UnexposedStmt -> cursor_UnexposedStmt;
Cursor_LabelStmt -> cursor_LabelStmt;
Cursor_LastStmt -> cursor_LastStmt;
Cursor_TranslationUnit -> cursor_TranslationUnit;
Cursor_FirstAttr -> cursor_FirstAttr;
Cursor_UnexposedAttr -> cursor_UnexposedAttr;
Cursor_IBActionAttr -> cursor_IBActionAttr;
Cursor_IBOutletAttr -> cursor_IBOutletAttr;
Cursor_IBOutletCollectionAttr -> cursor_IBOutletCollectionAttr;
Cursor_LastAttr -> cursor_LastAttr;
Cursor_PreprocessingDirective -> cursor_PreprocessingDirective;
Cursor_MacroDefinition -> cursor_MacroDefinition;
Cursor_MacroInstantiation -> cursor_MacroInstantiation;
Cursor_InclusionDirective -> cursor_InclusionDirective;
Cursor_FirstPreprocessing -> cursor_FirstPreprocessing;
Cursor_LastPreprocessing -> cursor_LastPreprocessing
}
unmarshall_CursorKind :: Int -> CursorKind
unmarshall_CursorKind arg1 =
if arg1 == cursor_UnexposedDecl
then Cursor_UnexposedDecl
else if arg1 == cursor_StructDecl
then Cursor_StructDecl
else if arg1 == cursor_UnionDecl
then Cursor_UnionDecl
else if arg1 == cursor_ClassDecl
then Cursor_ClassDecl
else if arg1 == cursor_EnumDecl
then Cursor_EnumDecl
else if arg1 == cursor_FieldDecl
then Cursor_FieldDecl
else if arg1 == cursor_EnumConstantDecl
then Cursor_EnumConstantDecl
else if arg1 == cursor_FunctionDecl
then Cursor_FunctionDecl
else if arg1 == cursor_VarDecl
then Cursor_VarDecl
else if arg1 == cursor_ParmDecl
then Cursor_ParmDecl
else if arg1 == cursor_ObjCInterfaceDecl
then Cursor_ObjCInterfaceDecl
else if arg1 == cursor_ObjCCategoryDecl
then Cursor_ObjCCategoryDecl
else if arg1 == cursor_ObjCProtocolDecl
then Cursor_ObjCProtocolDecl
else if arg1 == cursor_ObjCPropertyDecl
then Cursor_ObjCPropertyDecl
else if arg1 == cursor_ObjCIvarDecl
then Cursor_ObjCIvarDecl
else if arg1 == cursor_ObjCInstanceMethodDecl
then Cursor_ObjCInstanceMethodDecl
else if arg1 == cursor_ObjCClassMethodDecl
then Cursor_ObjCClassMethodDecl
else if arg1 == cursor_ObjCImplementationDecl
then Cursor_ObjCImplementationDecl
else if arg1 == cursor_ObjCCategoryImplDecl
then Cursor_ObjCCategoryImplDecl
else if arg1 == cursor_TypedefDecl
then Cursor_TypedefDecl
else if arg1 == cursor_CXXMethod
then Cursor_CXXMethod
else if arg1 == cursor_Namespace
then Cursor_Namespace
else if arg1 == cursor_LinkageSpec
then Cursor_LinkageSpec
else if arg1 == cursor_Constructor
then Cursor_Constructor
else if arg1 == cursor_Destructor
then Cursor_Destructor
else if arg1 == cursor_ConversionFunction
then Cursor_ConversionFunction
else if arg1 == cursor_TemplateTypeParameter
then Cursor_TemplateTypeParameter
else if arg1 == cursor_NonTypeTemplateParameter
then Cursor_NonTypeTemplateParameter
else if arg1 == cursor_TemplateTemplateParameter
then Cursor_TemplateTemplateParameter
else if arg1 == cursor_FunctionTemplate
then Cursor_FunctionTemplate
else if arg1 == cursor_ClassTemplate
then Cursor_ClassTemplate
else if arg1 == cursor_ClassTemplatePartialSpecialization
then Cursor_ClassTemplatePartialSpecialization
else if arg1 == cursor_NamespaceAlias
then Cursor_NamespaceAlias
else if arg1 == cursor_UsingDirective
then Cursor_UsingDirective
else if arg1 == cursor_UsingDeclaration
then Cursor_UsingDeclaration
else if arg1 == cursor_FirstDecl
then Cursor_FirstDecl
else if arg1 == cursor_LastDecl
then Cursor_LastDecl
else if arg1 == cursor_FirstRef
then Cursor_FirstRef
else if arg1 == cursor_ObjCSuperClassRef
then Cursor_ObjCSuperClassRef
else if arg1 == cursor_ObjCProtocolRef
then Cursor_ObjCProtocolRef
else if arg1 == cursor_ObjCClassRef
then Cursor_ObjCClassRef
else if arg1 == cursor_TypeRef
then Cursor_TypeRef
else if arg1 == cursor_CXXBaseSpecifier
then Cursor_CXXBaseSpecifier
else if arg1 == cursor_TemplateRef
then Cursor_TemplateRef
else if arg1 == cursor_NamespaceRef
then Cursor_NamespaceRef
else if arg1 == cursor_MemberRef
then Cursor_MemberRef
else if arg1 == cursor_LabelRef
then Cursor_LabelRef
else if arg1 == cursor_OverloadedDeclRef
then Cursor_OverloadedDeclRef
else if arg1 == cursor_LastRef
then Cursor_LastRef
else if arg1 == cursor_FirstInvalid
then Cursor_FirstInvalid
else if arg1 == cursor_InvalidFile
then Cursor_InvalidFile
else if arg1 == cursor_NoDeclFound
then Cursor_NoDeclFound
else if arg1 == cursor_NotImplemented
then Cursor_NotImplemented
else if arg1 == cursor_InvalidCode
then Cursor_InvalidCode
else if arg1 == cursor_LastInvalid
then Cursor_LastInvalid
else if arg1 == cursor_FirstExpr
then Cursor_FirstExpr
else if arg1 == cursor_UnexposedExpr
then Cursor_UnexposedExpr
else if arg1 == cursor_DeclRefExpr
then Cursor_DeclRefExpr
else if arg1 == cursor_MemberRefExpr
then Cursor_MemberRefExpr
else if arg1 == cursor_CallExpr
then Cursor_CallExpr
else if arg1 == cursor_ObjCMessageExpr
then Cursor_ObjCMessageExpr
else if arg1 == cursor_BlockExpr
then Cursor_BlockExpr
else if arg1 == cursor_LastExpr
then Cursor_LastExpr
else if arg1 == cursor_FirstStmt
then Cursor_FirstStmt
else if arg1 == cursor_UnexposedStmt
then Cursor_UnexposedStmt
else if arg1 == cursor_LabelStmt
then Cursor_LabelStmt
else if arg1 == cursor_LastStmt
then Cursor_LastStmt
else if arg1 == cursor_TranslationUnit
then Cursor_TranslationUnit
else if arg1 == cursor_FirstAttr
then Cursor_FirstAttr
else if arg1 == cursor_UnexposedAttr
then Cursor_UnexposedAttr
else if arg1 == cursor_IBActionAttr
then Cursor_IBActionAttr
else if arg1 == cursor_IBOutletAttr
then Cursor_IBOutletAttr
else if arg1 == cursor_IBOutletCollectionAttr
then Cursor_IBOutletCollectionAttr
else if arg1 == cursor_LastAttr
then Cursor_LastAttr
else if arg1 == cursor_PreprocessingDirective
then Cursor_PreprocessingDirective
else if arg1 == cursor_MacroDefinition
then Cursor_MacroDefinition
else if arg1 == cursor_MacroInstantiation
then Cursor_MacroInstantiation
else if arg1 == cursor_InclusionDirective
then Cursor_InclusionDirective
else if arg1 == cursor_FirstPreprocessing
then Cursor_FirstPreprocessing
else if arg1 == cursor_LastPreprocessing
then Cursor_LastPreprocessing
else error ("unmarshall_CursorKind: unknown value ("++show arg1++")\n")
cursor_UnexposedDecl :: Int
cursor_UnexposedDecl =
unsafePerformIO(
prim_cursor_UnexposedDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_UnexposedDecl" prim_cursor_UnexposedDecl :: IO (Int)
cursor_StructDecl :: Int
cursor_StructDecl =
unsafePerformIO(
prim_cursor_StructDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_StructDecl" prim_cursor_StructDecl :: IO (Int)
cursor_UnionDecl :: Int
cursor_UnionDecl =
unsafePerformIO(
prim_cursor_UnionDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_UnionDecl" prim_cursor_UnionDecl :: IO (Int)
cursor_ClassDecl :: Int
cursor_ClassDecl =
unsafePerformIO(
prim_cursor_ClassDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ClassDecl" prim_cursor_ClassDecl :: IO (Int)
cursor_EnumDecl :: Int
cursor_EnumDecl =
unsafePerformIO(
prim_cursor_EnumDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_EnumDecl" prim_cursor_EnumDecl :: IO (Int)
cursor_FieldDecl :: Int
cursor_FieldDecl =
unsafePerformIO(
prim_cursor_FieldDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_FieldDecl" prim_cursor_FieldDecl :: IO (Int)
cursor_EnumConstantDecl :: Int
cursor_EnumConstantDecl =
unsafePerformIO(
prim_cursor_EnumConstantDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_EnumConstantDecl" prim_cursor_EnumConstantDecl :: IO (Int)
cursor_FunctionDecl :: Int
cursor_FunctionDecl =
unsafePerformIO(
prim_cursor_FunctionDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_FunctionDecl" prim_cursor_FunctionDecl :: IO (Int)
cursor_VarDecl :: Int
cursor_VarDecl =
unsafePerformIO(
prim_cursor_VarDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_VarDecl" prim_cursor_VarDecl :: IO (Int)
cursor_ParmDecl :: Int
cursor_ParmDecl =
unsafePerformIO(
prim_cursor_ParmDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ParmDecl" prim_cursor_ParmDecl :: IO (Int)
cursor_ObjCInterfaceDecl :: Int
cursor_ObjCInterfaceDecl =
unsafePerformIO(
prim_cursor_ObjCInterfaceDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ObjCInterfaceDecl" prim_cursor_ObjCInterfaceDecl :: IO (Int)
cursor_ObjCCategoryDecl :: Int
cursor_ObjCCategoryDecl =
unsafePerformIO(
prim_cursor_ObjCCategoryDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ObjCCategoryDecl" prim_cursor_ObjCCategoryDecl :: IO (Int)
cursor_ObjCProtocolDecl :: Int
cursor_ObjCProtocolDecl =
unsafePerformIO(
prim_cursor_ObjCProtocolDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ObjCProtocolDecl" prim_cursor_ObjCProtocolDecl :: IO (Int)
cursor_ObjCPropertyDecl :: Int
cursor_ObjCPropertyDecl =
unsafePerformIO(
prim_cursor_ObjCPropertyDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ObjCPropertyDecl" prim_cursor_ObjCPropertyDecl :: IO (Int)
cursor_ObjCIvarDecl :: Int
cursor_ObjCIvarDecl =
unsafePerformIO(
prim_cursor_ObjCIvarDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ObjCIvarDecl" prim_cursor_ObjCIvarDecl :: IO (Int)
cursor_ObjCInstanceMethodDecl :: Int
cursor_ObjCInstanceMethodDecl =
unsafePerformIO(
prim_cursor_ObjCInstanceMethodDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ObjCInstanceMethodDecl" prim_cursor_ObjCInstanceMethodDecl :: IO (Int)
cursor_ObjCClassMethodDecl :: Int
cursor_ObjCClassMethodDecl =
unsafePerformIO(
prim_cursor_ObjCClassMethodDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ObjCClassMethodDecl" prim_cursor_ObjCClassMethodDecl :: IO (Int)
cursor_ObjCImplementationDecl :: Int
cursor_ObjCImplementationDecl =
unsafePerformIO(
prim_cursor_ObjCImplementationDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ObjCImplementationDecl" prim_cursor_ObjCImplementationDecl :: IO (Int)
cursor_ObjCCategoryImplDecl :: Int
cursor_ObjCCategoryImplDecl =
unsafePerformIO(
prim_cursor_ObjCCategoryImplDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ObjCCategoryImplDecl" prim_cursor_ObjCCategoryImplDecl :: IO (Int)
cursor_TypedefDecl :: Int
cursor_TypedefDecl =
unsafePerformIO(
prim_cursor_TypedefDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_TypedefDecl" prim_cursor_TypedefDecl :: IO (Int)
cursor_CXXMethod :: Int
cursor_CXXMethod =
unsafePerformIO(
prim_cursor_CXXMethod
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_CXXMethod" prim_cursor_CXXMethod :: IO (Int)
cursor_Namespace :: Int
cursor_Namespace =
unsafePerformIO(
prim_cursor_Namespace
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_Namespace" prim_cursor_Namespace :: IO (Int)
cursor_LinkageSpec :: Int
cursor_LinkageSpec =
unsafePerformIO(
prim_cursor_LinkageSpec
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_LinkageSpec" prim_cursor_LinkageSpec :: IO (Int)
cursor_Constructor :: Int
cursor_Constructor =
unsafePerformIO(
prim_cursor_Constructor
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_Constructor" prim_cursor_Constructor :: IO (Int)
cursor_Destructor :: Int
cursor_Destructor =
unsafePerformIO(
prim_cursor_Destructor
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_Destructor" prim_cursor_Destructor :: IO (Int)
cursor_ConversionFunction :: Int
cursor_ConversionFunction =
unsafePerformIO(
prim_cursor_ConversionFunction
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ConversionFunction" prim_cursor_ConversionFunction :: IO (Int)
cursor_TemplateTypeParameter :: Int
cursor_TemplateTypeParameter =
unsafePerformIO(
prim_cursor_TemplateTypeParameter
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_TemplateTypeParameter" prim_cursor_TemplateTypeParameter :: IO (Int)
cursor_NonTypeTemplateParameter :: Int
cursor_NonTypeTemplateParameter =
unsafePerformIO(
prim_cursor_NonTypeTemplateParameter
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_NonTypeTemplateParameter" prim_cursor_NonTypeTemplateParameter :: IO (Int)
cursor_TemplateTemplateParameter :: Int
cursor_TemplateTemplateParameter =
unsafePerformIO(
prim_cursor_TemplateTemplateParameter
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_TemplateTemplateParameter" prim_cursor_TemplateTemplateParameter :: IO (Int)
cursor_FunctionTemplate :: Int
cursor_FunctionTemplate =
unsafePerformIO(
prim_cursor_FunctionTemplate
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_FunctionTemplate" prim_cursor_FunctionTemplate :: IO (Int)
cursor_ClassTemplate :: Int
cursor_ClassTemplate =
unsafePerformIO(
prim_cursor_ClassTemplate
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ClassTemplate" prim_cursor_ClassTemplate :: IO (Int)
cursor_ClassTemplatePartialSpecialization :: Int
cursor_ClassTemplatePartialSpecialization =
unsafePerformIO(
prim_cursor_ClassTemplatePartialSpecialization
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ClassTemplatePartialSpecialization" prim_cursor_ClassTemplatePartialSpecialization :: IO (Int)
cursor_NamespaceAlias :: Int
cursor_NamespaceAlias =
unsafePerformIO(
prim_cursor_NamespaceAlias
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_NamespaceAlias" prim_cursor_NamespaceAlias :: IO (Int)
cursor_UsingDirective :: Int
cursor_UsingDirective =
unsafePerformIO(
prim_cursor_UsingDirective
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_UsingDirective" prim_cursor_UsingDirective :: IO (Int)
cursor_UsingDeclaration :: Int
cursor_UsingDeclaration =
unsafePerformIO(
prim_cursor_UsingDeclaration
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_UsingDeclaration" prim_cursor_UsingDeclaration :: IO (Int)
cursor_FirstDecl :: Int
cursor_FirstDecl =
unsafePerformIO(
prim_cursor_FirstDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_FirstDecl" prim_cursor_FirstDecl :: IO (Int)
cursor_LastDecl :: Int
cursor_LastDecl =
unsafePerformIO(
prim_cursor_LastDecl
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_LastDecl" prim_cursor_LastDecl :: IO (Int)
cursor_FirstRef :: Int
cursor_FirstRef =
unsafePerformIO(
prim_cursor_FirstRef
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_FirstRef" prim_cursor_FirstRef :: IO (Int)
cursor_ObjCSuperClassRef :: Int
cursor_ObjCSuperClassRef =
unsafePerformIO(
prim_cursor_ObjCSuperClassRef
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ObjCSuperClassRef" prim_cursor_ObjCSuperClassRef :: IO (Int)
cursor_ObjCProtocolRef :: Int
cursor_ObjCProtocolRef =
unsafePerformIO(
prim_cursor_ObjCProtocolRef
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ObjCProtocolRef" prim_cursor_ObjCProtocolRef :: IO (Int)
cursor_ObjCClassRef :: Int
cursor_ObjCClassRef =
unsafePerformIO(
prim_cursor_ObjCClassRef
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ObjCClassRef" prim_cursor_ObjCClassRef :: IO (Int)
cursor_TypeRef :: Int
cursor_TypeRef =
unsafePerformIO(
prim_cursor_TypeRef
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_TypeRef" prim_cursor_TypeRef :: IO (Int)
cursor_CXXBaseSpecifier :: Int
cursor_CXXBaseSpecifier =
unsafePerformIO(
prim_cursor_CXXBaseSpecifier
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_CXXBaseSpecifier" prim_cursor_CXXBaseSpecifier :: IO (Int)
cursor_TemplateRef :: Int
cursor_TemplateRef =
unsafePerformIO(
prim_cursor_TemplateRef
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_TemplateRef" prim_cursor_TemplateRef :: IO (Int)
cursor_NamespaceRef :: Int
cursor_NamespaceRef =
unsafePerformIO(
prim_cursor_NamespaceRef
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_NamespaceRef" prim_cursor_NamespaceRef :: IO (Int)
cursor_MemberRef :: Int
cursor_MemberRef =
unsafePerformIO(
prim_cursor_MemberRef
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_MemberRef" prim_cursor_MemberRef :: IO (Int)
cursor_LabelRef :: Int
cursor_LabelRef =
unsafePerformIO(
prim_cursor_LabelRef
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_LabelRef" prim_cursor_LabelRef :: IO (Int)
cursor_OverloadedDeclRef :: Int
cursor_OverloadedDeclRef =
unsafePerformIO(
prim_cursor_OverloadedDeclRef
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_OverloadedDeclRef" prim_cursor_OverloadedDeclRef :: IO (Int)
cursor_LastRef :: Int
cursor_LastRef =
unsafePerformIO(
prim_cursor_LastRef
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_LastRef" prim_cursor_LastRef :: IO (Int)
cursor_FirstInvalid :: Int
cursor_FirstInvalid =
unsafePerformIO(
prim_cursor_FirstInvalid
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_FirstInvalid" prim_cursor_FirstInvalid :: IO (Int)
cursor_InvalidFile :: Int
cursor_InvalidFile =
unsafePerformIO(
prim_cursor_InvalidFile
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_InvalidFile" prim_cursor_InvalidFile :: IO (Int)
cursor_NoDeclFound :: Int
cursor_NoDeclFound =
unsafePerformIO(
prim_cursor_NoDeclFound
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_NoDeclFound" prim_cursor_NoDeclFound :: IO (Int)
cursor_NotImplemented :: Int
cursor_NotImplemented =
unsafePerformIO(
prim_cursor_NotImplemented
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_NotImplemented" prim_cursor_NotImplemented :: IO (Int)
cursor_InvalidCode :: Int
cursor_InvalidCode =
unsafePerformIO(
prim_cursor_InvalidCode
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_InvalidCode" prim_cursor_InvalidCode :: IO (Int)
cursor_LastInvalid :: Int
cursor_LastInvalid =
unsafePerformIO(
prim_cursor_LastInvalid
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_LastInvalid" prim_cursor_LastInvalid :: IO (Int)
cursor_FirstExpr :: Int
cursor_FirstExpr =
unsafePerformIO(
prim_cursor_FirstExpr
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_FirstExpr" prim_cursor_FirstExpr :: IO (Int)
cursor_UnexposedExpr :: Int
cursor_UnexposedExpr =
unsafePerformIO(
prim_cursor_UnexposedExpr
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_UnexposedExpr" prim_cursor_UnexposedExpr :: IO (Int)
cursor_DeclRefExpr :: Int
cursor_DeclRefExpr =
unsafePerformIO(
prim_cursor_DeclRefExpr
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_DeclRefExpr" prim_cursor_DeclRefExpr :: IO (Int)
cursor_MemberRefExpr :: Int
cursor_MemberRefExpr =
unsafePerformIO(
prim_cursor_MemberRefExpr
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_MemberRefExpr" prim_cursor_MemberRefExpr :: IO (Int)
cursor_CallExpr :: Int
cursor_CallExpr =
unsafePerformIO(
prim_cursor_CallExpr
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_CallExpr" prim_cursor_CallExpr :: IO (Int)
cursor_ObjCMessageExpr :: Int
cursor_ObjCMessageExpr =
unsafePerformIO(
prim_cursor_ObjCMessageExpr
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_ObjCMessageExpr" prim_cursor_ObjCMessageExpr :: IO (Int)
cursor_BlockExpr :: Int
cursor_BlockExpr =
unsafePerformIO(
prim_cursor_BlockExpr
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_BlockExpr" prim_cursor_BlockExpr :: IO (Int)
cursor_LastExpr :: Int
cursor_LastExpr =
unsafePerformIO(
prim_cursor_LastExpr
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_LastExpr" prim_cursor_LastExpr :: IO (Int)
cursor_FirstStmt :: Int
cursor_FirstStmt =
unsafePerformIO(
prim_cursor_FirstStmt
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_FirstStmt" prim_cursor_FirstStmt :: IO (Int)
cursor_UnexposedStmt :: Int
cursor_UnexposedStmt =
unsafePerformIO(
prim_cursor_UnexposedStmt
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_UnexposedStmt" prim_cursor_UnexposedStmt :: IO (Int)
cursor_LabelStmt :: Int
cursor_LabelStmt =
unsafePerformIO(
prim_cursor_LabelStmt
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_LabelStmt" prim_cursor_LabelStmt :: IO (Int)
cursor_LastStmt :: Int
cursor_LastStmt =
unsafePerformIO(
prim_cursor_LastStmt
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_LastStmt" prim_cursor_LastStmt :: IO (Int)
cursor_TranslationUnit :: Int
cursor_TranslationUnit =
unsafePerformIO(
prim_cursor_TranslationUnit
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_TranslationUnit" prim_cursor_TranslationUnit :: IO (Int)
cursor_FirstAttr :: Int
cursor_FirstAttr =
unsafePerformIO(
prim_cursor_FirstAttr
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_FirstAttr" prim_cursor_FirstAttr :: IO (Int)
cursor_UnexposedAttr :: Int
cursor_UnexposedAttr =
unsafePerformIO(
prim_cursor_UnexposedAttr
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_UnexposedAttr" prim_cursor_UnexposedAttr :: IO (Int)
cursor_IBActionAttr :: Int
cursor_IBActionAttr =
unsafePerformIO(
prim_cursor_IBActionAttr
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_IBActionAttr" prim_cursor_IBActionAttr :: IO (Int)
cursor_IBOutletAttr :: Int
cursor_IBOutletAttr =
unsafePerformIO(
prim_cursor_IBOutletAttr
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_IBOutletAttr" prim_cursor_IBOutletAttr :: IO (Int)
cursor_IBOutletCollectionAttr :: Int
cursor_IBOutletCollectionAttr =
unsafePerformIO(
prim_cursor_IBOutletCollectionAttr
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_IBOutletCollectionAttr" prim_cursor_IBOutletCollectionAttr :: IO (Int)
cursor_LastAttr :: Int
cursor_LastAttr =
unsafePerformIO(
prim_cursor_LastAttr
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_LastAttr" prim_cursor_LastAttr :: IO (Int)
cursor_PreprocessingDirective :: Int
cursor_PreprocessingDirective =
unsafePerformIO(
prim_cursor_PreprocessingDirective
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_PreprocessingDirective" prim_cursor_PreprocessingDirective :: IO (Int)
cursor_MacroDefinition :: Int
cursor_MacroDefinition =
unsafePerformIO(
prim_cursor_MacroDefinition
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_MacroDefinition" prim_cursor_MacroDefinition :: IO (Int)
cursor_MacroInstantiation :: Int
cursor_MacroInstantiation =
unsafePerformIO(
prim_cursor_MacroInstantiation
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_MacroInstantiation" prim_cursor_MacroInstantiation :: IO (Int)
cursor_InclusionDirective :: Int
cursor_InclusionDirective =
unsafePerformIO(
prim_cursor_InclusionDirective
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_InclusionDirective" prim_cursor_InclusionDirective :: IO (Int)
cursor_FirstPreprocessing :: Int
cursor_FirstPreprocessing =
unsafePerformIO(
prim_cursor_FirstPreprocessing
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_FirstPreprocessing" prim_cursor_FirstPreprocessing :: IO (Int)
cursor_LastPreprocessing :: Int
cursor_LastPreprocessing =
unsafePerformIO(
prim_cursor_LastPreprocessing
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cursor_LastPreprocessing" prim_cursor_LastPreprocessing :: IO (Int)
data Cursor = Cursor CursorKind (Ptr ()) (Ptr ()) (Ptr ())
foreign import ccall unsafe "FFI_stub_ffi.h sizeOfCXCursor" sizeOfCXCursor :: CUInt
foreign import ccall unsafe "FFI_stub_ffi.h getCXCursorData" getCXCursorData :: Ptr () -> CInt -> IO (Ptr ())
foreign import ccall unsafe "FFI_stub_ffi.h getCXCursorKind" getCXCursorKind :: Ptr () -> IO CUInt
foreign import ccall unsafe "FFI_stub_ffi.h setCXCursorData" setCXCursorData :: Ptr () -> CInt -> Ptr () -> IO ()
foreign import ccall unsafe "FFI_stub_ffi.h setCXCursorKind" setCXCursorKind :: Ptr () -> CUInt -> IO ()
instance Storable Cursor where
sizeOf _ = fromIntegral sizeOfCXCursor
alignment _ = 4
peek p = do
let ptr = castPtr p
k <- (unmarshall_CursorKind . fromIntegral) <$> getCXCursorKind ptr
p1 <- getCXCursorData ptr 0
p2 <- getCXCursorData ptr 1
p3 <- getCXCursorData ptr 2
return $ Cursor k p1 p2 p3
poke p (Cursor k p1 p2 p3) = do
let ptr = castPtr p
setCXCursorKind ptr $ fromIntegral (marshall_CursorKind k)
setCXCursorData ptr 0 p1
setCXCursorData ptr 1 p2
setCXCursorData ptr 2 p3
getNullCursor :: IO Cursor
getNullCursor =
prim_getNullCursor
>>= \ gc_result ->
access_prim_getNullCursor_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getNullCursor_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getNullCursor_gc_res4 gc_result >>= \ gc_res4 ->
access_prim_getNullCursor_gc_res5 gc_result >>= \ gc_res5 ->
let gc_res1 = (unmarshall_CursorKind (gc_res2)) in
(return ((Cursor gc_res1 gc_res3 gc_res4 gc_res5)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getNullCursor" prim_getNullCursor :: IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getNullCursor_gc_res2 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getNullCursor_gc_res3 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getNullCursor_gc_res4 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getNullCursor_gc_res5 :: Ptr a1 -> IO (Ptr r1)
getTranslationUnitCursor :: TranslationUnit -> IO Cursor
getTranslationUnitCursor t =
prim_getTranslationUnitCursor t
>>= \ gc_result ->
access_prim_getTranslationUnitCursor_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getTranslationUnitCursor_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getTranslationUnitCursor_gc_res4 gc_result >>= \ gc_res4 ->
access_prim_getTranslationUnitCursor_gc_res5 gc_result >>= \ gc_res5 ->
let gc_res1 = (unmarshall_CursorKind (gc_res2)) in
(return ((Cursor gc_res1 gc_res3 gc_res4 gc_res5)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getTranslationUnitCursor" prim_getTranslationUnitCursor :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getTranslationUnitCursor_gc_res2 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getTranslationUnitCursor_gc_res3 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getTranslationUnitCursor_gc_res4 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getTranslationUnitCursor_gc_res5 :: Ptr a1 -> IO (Ptr r1)
equalCursors :: Cursor -> Cursor -> IO Bool
equalCursors gc_arg1 gc_arg3 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
case gc_arg3 of { (Cursor gc_arg4 p12 p22 p32) ->
case (marshall_CursorKind gc_arg4) of { k2 ->
prim_equalCursors k p1 p2 p3 k2 p12 p22 p32
>>= \ r ->
(unmarshall_bool_ r) >>= \ gc_res1 ->
(return (gc_res1))}}}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_equalCursors" prim_equalCursors :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> Int -> Ptr a6 -> Ptr a7 -> Ptr a8 -> IO (Int)
hashCursor :: Cursor -> IO Word32
hashCursor gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_hashCursor k p1 p2 p3
>>= \ r ->
(return (r))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_hashCursor" prim_hashCursor :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Word32)
getCursorKind :: Cursor -> IO CursorKind
getCursorKind gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getCursorKind k p1 p2 p3
>>= \ r ->
let gc_res1 = (unmarshall_CursorKind (r)) in
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCursorKind" prim_getCursorKind :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Int)
isDeclaration :: CursorKind -> IO Bool
isDeclaration gc_arg1 =
case (marshall_CursorKind gc_arg1) of { arg1 ->
prim_isDeclaration arg1
>>= \ res1 ->
(unmarshall_bool_ res1) >>= \ gc_res1 ->
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_isDeclaration" prim_isDeclaration :: Int -> IO (Int)
isReference :: CursorKind -> IO Bool
isReference gc_arg1 =
case (marshall_CursorKind gc_arg1) of { arg1 ->
prim_isReference arg1
>>= \ res1 ->
(unmarshall_bool_ res1) >>= \ gc_res1 ->
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_isReference" prim_isReference :: Int -> IO (Int)
isExpression :: CursorKind -> IO Bool
isExpression gc_arg1 =
case (marshall_CursorKind gc_arg1) of { arg1 ->
prim_isExpression arg1
>>= \ res1 ->
(unmarshall_bool_ res1) >>= \ gc_res1 ->
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_isExpression" prim_isExpression :: Int -> IO (Int)
isStatement :: CursorKind -> IO Bool
isStatement gc_arg1 =
case (marshall_CursorKind gc_arg1) of { arg1 ->
prim_isStatement arg1
>>= \ res1 ->
(unmarshall_bool_ res1) >>= \ gc_res1 ->
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_isStatement" prim_isStatement :: Int -> IO (Int)
isInvalid :: CursorKind -> IO Bool
isInvalid gc_arg1 =
case (marshall_CursorKind gc_arg1) of { arg1 ->
prim_isInvalid arg1
>>= \ res1 ->
(unmarshall_bool_ res1) >>= \ gc_res1 ->
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_isInvalid" prim_isInvalid :: Int -> IO (Int)
isTranslationUnit :: CursorKind -> IO Bool
isTranslationUnit gc_arg1 =
case (marshall_CursorKind gc_arg1) of { arg1 ->
prim_isTranslationUnit arg1
>>= \ res1 ->
(unmarshall_bool_ res1) >>= \ gc_res1 ->
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_isTranslationUnit" prim_isTranslationUnit :: Int -> IO (Int)
isPreprocessing :: CursorKind -> IO Bool
isPreprocessing gc_arg1 =
case (marshall_CursorKind gc_arg1) of { arg1 ->
prim_isPreprocessing arg1
>>= \ res1 ->
(unmarshall_bool_ res1) >>= \ gc_res1 ->
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_isPreprocessing" prim_isPreprocessing :: Int -> IO (Int)
isUnexposed :: CursorKind -> IO Bool
isUnexposed gc_arg1 =
case (marshall_CursorKind gc_arg1) of { arg1 ->
prim_isUnexposed arg1
>>= \ res1 ->
(unmarshall_bool_ res1) >>= \ gc_res1 ->
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_isUnexposed" prim_isUnexposed :: Int -> IO (Int)
data LinkageKind
= Linkage_Invalid
| Linkage_NoLinkage
| Linkage_Internal
| Linkage_UniqueExternal
| Linkage_External
deriving (Eq)
marshall_LinkageKind :: LinkageKind -> Int
marshall_LinkageKind arg1 =
case arg1 of {
Linkage_Invalid -> linkage_Invalid;
Linkage_NoLinkage -> linkage_NoLinkage;
Linkage_Internal -> linkage_Internal;
Linkage_UniqueExternal -> linkage_UniqueExternal;
Linkage_External -> linkage_External
}
unmarshall_LinkageKind :: Int -> LinkageKind
unmarshall_LinkageKind arg1 =
if arg1 == linkage_Invalid
then Linkage_Invalid
else if arg1 == linkage_NoLinkage
then Linkage_NoLinkage
else if arg1 == linkage_Internal
then Linkage_Internal
else if arg1 == linkage_UniqueExternal
then Linkage_UniqueExternal
else if arg1 == linkage_External
then Linkage_External
else error ("unmarshall_LinkageKind: unknown value ("++show arg1++")\n")
linkage_Invalid :: Int
linkage_Invalid =
unsafePerformIO(
prim_linkage_Invalid
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_linkage_Invalid" prim_linkage_Invalid :: IO (Int)
linkage_NoLinkage :: Int
linkage_NoLinkage =
unsafePerformIO(
prim_linkage_NoLinkage
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_linkage_NoLinkage" prim_linkage_NoLinkage :: IO (Int)
linkage_Internal :: Int
linkage_Internal =
unsafePerformIO(
prim_linkage_Internal
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_linkage_Internal" prim_linkage_Internal :: IO (Int)
linkage_UniqueExternal :: Int
linkage_UniqueExternal =
unsafePerformIO(
prim_linkage_UniqueExternal
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_linkage_UniqueExternal" prim_linkage_UniqueExternal :: IO (Int)
linkage_External :: Int
linkage_External =
unsafePerformIO(
prim_linkage_External
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_linkage_External" prim_linkage_External :: IO (Int)
getCursorLinkage :: Cursor -> IO LinkageKind
getCursorLinkage gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getCursorLinkage k p1 p2 p3
>>= \ r ->
let gc_res1 = (unmarshall_LinkageKind (r)) in
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCursorLinkage" prim_getCursorLinkage :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Int)
getCursorAvailability :: Cursor -> IO AvailabilityKind
getCursorAvailability gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getCursorAvailability k p1 p2 p3
>>= \ r ->
let gc_res1 = (unmarshall_AvailabilityKind (r)) in
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCursorAvailability" prim_getCursorAvailability :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Int)
data LanguageKind
= Language_Invalid
| Language_C
| Language_ObjC
| Language_CPlusPlus
deriving (Eq)
marshall_LanguageKind :: LanguageKind -> Int
marshall_LanguageKind arg1 =
case arg1 of {
Language_Invalid -> language_Invalid;
Language_C -> language_C;
Language_ObjC -> language_ObjC;
Language_CPlusPlus -> language_CPlusPlus
}
unmarshall_LanguageKind :: Int -> LanguageKind
unmarshall_LanguageKind arg1 =
if arg1 == language_Invalid
then Language_Invalid
else if arg1 == language_C
then Language_C
else if arg1 == language_ObjC
then Language_ObjC
else if arg1 == language_CPlusPlus
then Language_CPlusPlus
else error ("unmarshall_LanguageKind: unknown value ("++show arg1++")\n")
language_Invalid :: Int
language_Invalid =
unsafePerformIO(
prim_language_Invalid
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_language_Invalid" prim_language_Invalid :: IO (Int)
language_C :: Int
language_C =
unsafePerformIO(
prim_language_C
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_language_C" prim_language_C :: IO (Int)
language_ObjC :: Int
language_ObjC =
unsafePerformIO(
prim_language_ObjC
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_language_ObjC" prim_language_ObjC :: IO (Int)
language_CPlusPlus :: Int
language_CPlusPlus =
unsafePerformIO(
prim_language_CPlusPlus
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_language_CPlusPlus" prim_language_CPlusPlus :: IO (Int)
getCursorLanguage :: Cursor -> IO LanguageKind
getCursorLanguage gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getCursorLanguage k p1 p2 p3
>>= \ r ->
let gc_res1 = (unmarshall_LanguageKind (r)) in
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCursorLanguage" prim_getCursorLanguage :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Int)
data CursorSetObj
type CursorSet = ForeignPtr CursorSetObj
foreign import ccall unsafe "clang-c/Index.h &clang_disposeCXCursorSet" clang_disposeCXCursorSet :: FunPtr (Ptr CursorSetObj -> IO ())
unmarshall_cursorSet :: Ptr CursorSetObj -> IO (ForeignPtr CursorSetObj)
unmarshall_cursorSet = newForeignPtr clang_disposeCXCursorSet
createCXCursorSet :: IO CursorSet
createCXCursorSet =
prim_createCXCursorSet
>>= \ r ->
(unmarshall_cursorSet r) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_createCXCursorSet" prim_createCXCursorSet :: IO (Ptr r1)
cXCursorSet_contains :: CursorSet -> Cursor -> IO Bool
cXCursorSet_contains gc_arg1 gc_arg2 =
(marshall_fptr gc_arg1) >>= \ (cs) ->
case gc_arg2 of { (Cursor gc_arg3 p1 p2 p3) ->
case (marshall_CursorKind gc_arg3) of { k ->
prim_cXCursorSet_contains cs k p1 p2 p3
>>= \ gc_res2 ->
(unmarshall_bool_ gc_res2) >>= \ gc_res1 ->
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_cXCursorSet_contains" prim_cXCursorSet_contains :: Ptr a1 -> Int -> Ptr a3 -> Ptr a4 -> Ptr a5 -> IO (Int)
cXCursorSet_insert :: CursorSet -> Cursor -> IO Bool
cXCursorSet_insert gc_arg1 gc_arg2 =
(marshall_fptr gc_arg1) >>= \ (cs) ->
case gc_arg2 of { (Cursor gc_arg3 p1 p2 p3) ->
case (marshall_CursorKind gc_arg3) of { k ->
prim_cXCursorSet_insert cs k p1 p2 p3
>>= \ gc_res2 ->
(unmarshall_bool_ gc_res2) >>= \ gc_res1 ->
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_cXCursorSet_insert" prim_cXCursorSet_insert :: Ptr a1 -> Int -> Ptr a3 -> Ptr a4 -> Ptr a5 -> IO (Int)
getCursorSemanticParent :: Cursor -> IO Cursor
getCursorSemanticParent gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getCursorSemanticParent k p1 p2 p3
>>= \ gc_result ->
access_prim_getCursorSemanticParent_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getCursorSemanticParent_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getCursorSemanticParent_gc_res4 gc_result >>= \ gc_res4 ->
access_prim_getCursorSemanticParent_gc_res5 gc_result >>= \ gc_res5 ->
let gc_res1 = (unmarshall_CursorKind (gc_res2)) in
(return ((Cursor gc_res1 gc_res3 gc_res4 gc_res5)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCursorSemanticParent" prim_getCursorSemanticParent :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorSemanticParent_gc_res2 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorSemanticParent_gc_res3 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorSemanticParent_gc_res4 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorSemanticParent_gc_res5 :: Ptr a1 -> IO (Ptr r1)
getCursorLexicalParent :: Cursor -> IO Cursor
getCursorLexicalParent gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getCursorLexicalParent k p1 p2 p3
>>= \ gc_result ->
access_prim_getCursorLexicalParent_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getCursorLexicalParent_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getCursorLexicalParent_gc_res4 gc_result >>= \ gc_res4 ->
access_prim_getCursorLexicalParent_gc_res5 gc_result >>= \ gc_res5 ->
let gc_res1 = (unmarshall_CursorKind (gc_res2)) in
(return ((Cursor gc_res1 gc_res3 gc_res4 gc_res5)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCursorLexicalParent" prim_getCursorLexicalParent :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorLexicalParent_gc_res2 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorLexicalParent_gc_res3 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorLexicalParent_gc_res4 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorLexicalParent_gc_res5 :: Ptr a1 -> IO (Ptr r1)
type CursorList = [Cursor]
foreign import ccall unsafe "FFI_stub_ffi.h cursorListGetKind" cursorListGetKind_ :: Ptr () -> CInt -> IO Int
foreign import ccall unsafe "FFI_stub_ffi.h cursorListGetPtr" cursorListGetPtr_ :: Ptr () -> CInt -> CInt -> IO (Ptr ())
foreign import ccall unsafe "clang-c/Index.h clang_disposeOverriddenCursors" clang_disposeOverriddenCursors :: Ptr () -> IO ()
unmarshall_cursorList :: Int -> Ptr () -> IO CursorList
unmarshall_cursorList numO os = do
cursors <- mapM getCursor_ [0..nO]
clang_disposeOverriddenCursors os
return cursors
where nO = fromIntegral (numO1)
getCursor_ i = do
kind <- unmarshall_CursorKind <$> (cursorListGetKind_ os i)
p1 <- cursorListGetPtr_ os i 0
p2 <- cursorListGetPtr_ os i 1
p3 <- cursorListGetPtr_ os i 2
return $ Cursor kind p1 p2 p3
getOverriddenCursors :: Cursor -> IO CursorList
getOverriddenCursors gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getOverriddenCursors k p1 p2 p3
>>= \ gc_result ->
access_prim_getOverriddenCursors_num_overrides gc_result >>= \ num_overrides ->
access_prim_getOverriddenCursors_overrides gc_result >>= \ overrides ->
(unmarshall_cursorList num_overrides overrides) >>= \ gc_res1 ->
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getOverriddenCursors" prim_getOverriddenCursors :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getOverriddenCursors_num_overrides :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getOverriddenCursors_overrides :: Ptr a1 -> IO (Ptr r1)
getIncludedFile :: Cursor -> IO File
getIncludedFile gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getIncludedFile k p1 p2 p3
>>= \ gc_res1 ->
(return ((File gc_res1)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getIncludedFile" prim_getIncludedFile :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Ptr r1)
getCursor :: TranslationUnit -> SourceLocation -> IO Cursor
getCursor t gc_arg1 =
case gc_arg1 of { (SourceLocation p1 p2 d) ->
prim_getCursor t p1 p2 d
>>= \ gc_result ->
access_prim_getCursor_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getCursor_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getCursor_gc_res4 gc_result >>= \ gc_res4 ->
access_prim_getCursor_gc_res5 gc_result >>= \ gc_res5 ->
let gc_res1 = (unmarshall_CursorKind (gc_res2)) in
(return ((Cursor gc_res1 gc_res3 gc_res4 gc_res5)))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCursor" prim_getCursor :: Ptr a1 -> Ptr a2 -> Ptr a3 -> Int -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursor_gc_res2 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursor_gc_res3 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursor_gc_res4 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursor_gc_res5 :: Ptr a1 -> IO (Ptr r1)
getCursorLocation :: Cursor -> IO SourceLocation
getCursorLocation gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getCursorLocation k p1 p2 p3
>>= \ gc_result ->
access_prim_getCursorLocation_gc_res1 gc_result >>= \ gc_res1 ->
access_prim_getCursorLocation_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getCursorLocation_gc_res3 gc_result >>= \ gc_res3 ->
(return ((SourceLocation gc_res1 gc_res2 gc_res3)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCursorLocation" prim_getCursorLocation :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorLocation_gc_res1 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorLocation_gc_res2 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorLocation_gc_res3 :: Ptr a1 -> IO (Int)
getCursorExtent :: Cursor -> IO SourceRange
getCursorExtent gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getCursorExtent k p1 p2 p3
>>= \ gc_result ->
access_prim_getCursorExtent_gc_res1 gc_result >>= \ gc_res1 ->
access_prim_getCursorExtent_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getCursorExtent_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getCursorExtent_gc_res4 gc_result >>= \ gc_res4 ->
(return ((SourceRange gc_res1 gc_res2 gc_res3 gc_res4)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCursorExtent" prim_getCursorExtent :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorExtent_gc_res1 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorExtent_gc_res2 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorExtent_gc_res3 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorExtent_gc_res4 :: Ptr a1 -> IO (Int)
data TypeKind
= Type_Invalid
| Type_Unexposed
| Type_Void
| Type_Bool
| Type_Char_U
| Type_UChar
| Type_Char16
| Type_Char32
| Type_UShort
| Type_UInt
| Type_ULong
| Type_ULongLong
| Type_UInt128
| Type_Char_S
| Type_SChar
| Type_WChar
| Type_Short
| Type_Int
| Type_Long
| Type_LongLong
| Type_Int128
| Type_Float
| Type_Double
| Type_LongDouble
| Type_NullPtr
| Type_Overload
| Type_Dependent
| Type_ObjCId
| Type_ObjCClass
| Type_ObjCSel
| Type_FirstBuiltin
| Type_LastBuiltin
| Type_Complex
| Type_Pointer
| Type_BlockPointer
| Type_LValueReference
| Type_RValueReference
| Type_Record
| Type_Enum
| Type_Typedef
| Type_ObjCInterface
| Type_ObjCObjectPointer
| Type_FunctionNoProto
| Type_FunctionProto
deriving (Eq)
marshall_TypeKind :: TypeKind -> Int
marshall_TypeKind arg1 =
case arg1 of {
Type_Invalid -> type_Invalid;
Type_Unexposed -> type_Unexposed;
Type_Void -> type_Void;
Type_Bool -> type_Bool;
Type_Char_U -> type_Char_U;
Type_UChar -> type_UChar;
Type_Char16 -> type_Char16;
Type_Char32 -> type_Char32;
Type_UShort -> type_UShort;
Type_UInt -> type_UInt;
Type_ULong -> type_ULong;
Type_ULongLong -> type_ULongLong;
Type_UInt128 -> type_UInt128;
Type_Char_S -> type_Char_S;
Type_SChar -> type_SChar;
Type_WChar -> type_WChar;
Type_Short -> type_Short;
Type_Int -> type_Int;
Type_Long -> type_Long;
Type_LongLong -> type_LongLong;
Type_Int128 -> type_Int128;
Type_Float -> type_Float;
Type_Double -> type_Double;
Type_LongDouble -> type_LongDouble;
Type_NullPtr -> type_NullPtr;
Type_Overload -> type_Overload;
Type_Dependent -> type_Dependent;
Type_ObjCId -> type_ObjCId;
Type_ObjCClass -> type_ObjCClass;
Type_ObjCSel -> type_ObjCSel;
Type_FirstBuiltin -> type_FirstBuiltin;
Type_LastBuiltin -> type_LastBuiltin;
Type_Complex -> type_Complex;
Type_Pointer -> type_Pointer;
Type_BlockPointer -> type_BlockPointer;
Type_LValueReference -> type_LValueReference;
Type_RValueReference -> type_RValueReference;
Type_Record -> type_Record;
Type_Enum -> type_Enum;
Type_Typedef -> type_Typedef;
Type_ObjCInterface -> type_ObjCInterface;
Type_ObjCObjectPointer -> type_ObjCObjectPointer;
Type_FunctionNoProto -> type_FunctionNoProto;
Type_FunctionProto -> type_FunctionProto
}
unmarshall_TypeKind :: Int -> TypeKind
unmarshall_TypeKind arg1 =
if arg1 == type_Invalid
then Type_Invalid
else if arg1 == type_Unexposed
then Type_Unexposed
else if arg1 == type_Void
then Type_Void
else if arg1 == type_Bool
then Type_Bool
else if arg1 == type_Char_U
then Type_Char_U
else if arg1 == type_UChar
then Type_UChar
else if arg1 == type_Char16
then Type_Char16
else if arg1 == type_Char32
then Type_Char32
else if arg1 == type_UShort
then Type_UShort
else if arg1 == type_UInt
then Type_UInt
else if arg1 == type_ULong
then Type_ULong
else if arg1 == type_ULongLong
then Type_ULongLong
else if arg1 == type_UInt128
then Type_UInt128
else if arg1 == type_Char_S
then Type_Char_S
else if arg1 == type_SChar
then Type_SChar
else if arg1 == type_WChar
then Type_WChar
else if arg1 == type_Short
then Type_Short
else if arg1 == type_Int
then Type_Int
else if arg1 == type_Long
then Type_Long
else if arg1 == type_LongLong
then Type_LongLong
else if arg1 == type_Int128
then Type_Int128
else if arg1 == type_Float
then Type_Float
else if arg1 == type_Double
then Type_Double
else if arg1 == type_LongDouble
then Type_LongDouble
else if arg1 == type_NullPtr
then Type_NullPtr
else if arg1 == type_Overload
then Type_Overload
else if arg1 == type_Dependent
then Type_Dependent
else if arg1 == type_ObjCId
then Type_ObjCId
else if arg1 == type_ObjCClass
then Type_ObjCClass
else if arg1 == type_ObjCSel
then Type_ObjCSel
else if arg1 == type_FirstBuiltin
then Type_FirstBuiltin
else if arg1 == type_LastBuiltin
then Type_LastBuiltin
else if arg1 == type_Complex
then Type_Complex
else if arg1 == type_Pointer
then Type_Pointer
else if arg1 == type_BlockPointer
then Type_BlockPointer
else if arg1 == type_LValueReference
then Type_LValueReference
else if arg1 == type_RValueReference
then Type_RValueReference
else if arg1 == type_Record
then Type_Record
else if arg1 == type_Enum
then Type_Enum
else if arg1 == type_Typedef
then Type_Typedef
else if arg1 == type_ObjCInterface
then Type_ObjCInterface
else if arg1 == type_ObjCObjectPointer
then Type_ObjCObjectPointer
else if arg1 == type_FunctionNoProto
then Type_FunctionNoProto
else if arg1 == type_FunctionProto
then Type_FunctionProto
else error ("unmarshall_TypeKind: unknown value ("++show arg1++")\n")
type_Invalid :: Int
type_Invalid =
unsafePerformIO(
prim_type_Invalid
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Invalid" prim_type_Invalid :: IO (Int)
type_Unexposed :: Int
type_Unexposed =
unsafePerformIO(
prim_type_Unexposed
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Unexposed" prim_type_Unexposed :: IO (Int)
type_Void :: Int
type_Void =
unsafePerformIO(
prim_type_Void
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Void" prim_type_Void :: IO (Int)
type_Bool :: Int
type_Bool =
unsafePerformIO(
prim_type_Bool
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Bool" prim_type_Bool :: IO (Int)
type_Char_U :: Int
type_Char_U =
unsafePerformIO(
prim_type_Char_U
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Char_U" prim_type_Char_U :: IO (Int)
type_UChar :: Int
type_UChar =
unsafePerformIO(
prim_type_UChar
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_UChar" prim_type_UChar :: IO (Int)
type_Char16 :: Int
type_Char16 =
unsafePerformIO(
prim_type_Char16
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Char16" prim_type_Char16 :: IO (Int)
type_Char32 :: Int
type_Char32 =
unsafePerformIO(
prim_type_Char32
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Char32" prim_type_Char32 :: IO (Int)
type_UShort :: Int
type_UShort =
unsafePerformIO(
prim_type_UShort
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_UShort" prim_type_UShort :: IO (Int)
type_UInt :: Int
type_UInt =
unsafePerformIO(
prim_type_UInt
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_UInt" prim_type_UInt :: IO (Int)
type_ULong :: Int
type_ULong =
unsafePerformIO(
prim_type_ULong
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_ULong" prim_type_ULong :: IO (Int)
type_ULongLong :: Int
type_ULongLong =
unsafePerformIO(
prim_type_ULongLong
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_ULongLong" prim_type_ULongLong :: IO (Int)
type_UInt128 :: Int
type_UInt128 =
unsafePerformIO(
prim_type_UInt128
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_UInt128" prim_type_UInt128 :: IO (Int)
type_Char_S :: Int
type_Char_S =
unsafePerformIO(
prim_type_Char_S
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Char_S" prim_type_Char_S :: IO (Int)
type_SChar :: Int
type_SChar =
unsafePerformIO(
prim_type_SChar
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_SChar" prim_type_SChar :: IO (Int)
type_WChar :: Int
type_WChar =
unsafePerformIO(
prim_type_WChar
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_WChar" prim_type_WChar :: IO (Int)
type_Short :: Int
type_Short =
unsafePerformIO(
prim_type_Short
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Short" prim_type_Short :: IO (Int)
type_Int :: Int
type_Int =
unsafePerformIO(
prim_type_Int
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Int" prim_type_Int :: IO (Int)
type_Long :: Int
type_Long =
unsafePerformIO(
prim_type_Long
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Long" prim_type_Long :: IO (Int)
type_LongLong :: Int
type_LongLong =
unsafePerformIO(
prim_type_LongLong
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_LongLong" prim_type_LongLong :: IO (Int)
type_Int128 :: Int
type_Int128 =
unsafePerformIO(
prim_type_Int128
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Int128" prim_type_Int128 :: IO (Int)
type_Float :: Int
type_Float =
unsafePerformIO(
prim_type_Float
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Float" prim_type_Float :: IO (Int)
type_Double :: Int
type_Double =
unsafePerformIO(
prim_type_Double
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Double" prim_type_Double :: IO (Int)
type_LongDouble :: Int
type_LongDouble =
unsafePerformIO(
prim_type_LongDouble
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_LongDouble" prim_type_LongDouble :: IO (Int)
type_NullPtr :: Int
type_NullPtr =
unsafePerformIO(
prim_type_NullPtr
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_NullPtr" prim_type_NullPtr :: IO (Int)
type_Overload :: Int
type_Overload =
unsafePerformIO(
prim_type_Overload
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Overload" prim_type_Overload :: IO (Int)
type_Dependent :: Int
type_Dependent =
unsafePerformIO(
prim_type_Dependent
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Dependent" prim_type_Dependent :: IO (Int)
type_ObjCId :: Int
type_ObjCId =
unsafePerformIO(
prim_type_ObjCId
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_ObjCId" prim_type_ObjCId :: IO (Int)
type_ObjCClass :: Int
type_ObjCClass =
unsafePerformIO(
prim_type_ObjCClass
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_ObjCClass" prim_type_ObjCClass :: IO (Int)
type_ObjCSel :: Int
type_ObjCSel =
unsafePerformIO(
prim_type_ObjCSel
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_ObjCSel" prim_type_ObjCSel :: IO (Int)
type_FirstBuiltin :: Int
type_FirstBuiltin =
unsafePerformIO(
prim_type_FirstBuiltin
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_FirstBuiltin" prim_type_FirstBuiltin :: IO (Int)
type_LastBuiltin :: Int
type_LastBuiltin =
unsafePerformIO(
prim_type_LastBuiltin
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_LastBuiltin" prim_type_LastBuiltin :: IO (Int)
type_Complex :: Int
type_Complex =
unsafePerformIO(
prim_type_Complex
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Complex" prim_type_Complex :: IO (Int)
type_Pointer :: Int
type_Pointer =
unsafePerformIO(
prim_type_Pointer
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Pointer" prim_type_Pointer :: IO (Int)
type_BlockPointer :: Int
type_BlockPointer =
unsafePerformIO(
prim_type_BlockPointer
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_BlockPointer" prim_type_BlockPointer :: IO (Int)
type_LValueReference :: Int
type_LValueReference =
unsafePerformIO(
prim_type_LValueReference
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_LValueReference" prim_type_LValueReference :: IO (Int)
type_RValueReference :: Int
type_RValueReference =
unsafePerformIO(
prim_type_RValueReference
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_RValueReference" prim_type_RValueReference :: IO (Int)
type_Record :: Int
type_Record =
unsafePerformIO(
prim_type_Record
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Record" prim_type_Record :: IO (Int)
type_Enum :: Int
type_Enum =
unsafePerformIO(
prim_type_Enum
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Enum" prim_type_Enum :: IO (Int)
type_Typedef :: Int
type_Typedef =
unsafePerformIO(
prim_type_Typedef
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_Typedef" prim_type_Typedef :: IO (Int)
type_ObjCInterface :: Int
type_ObjCInterface =
unsafePerformIO(
prim_type_ObjCInterface
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_ObjCInterface" prim_type_ObjCInterface :: IO (Int)
type_ObjCObjectPointer :: Int
type_ObjCObjectPointer =
unsafePerformIO(
prim_type_ObjCObjectPointer
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_ObjCObjectPointer" prim_type_ObjCObjectPointer :: IO (Int)
type_FunctionNoProto :: Int
type_FunctionNoProto =
unsafePerformIO(
prim_type_FunctionNoProto
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_FunctionNoProto" prim_type_FunctionNoProto :: IO (Int)
type_FunctionProto :: Int
type_FunctionProto =
unsafePerformIO(
prim_type_FunctionProto
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_type_FunctionProto" prim_type_FunctionProto :: IO (Int)
data Type = Type TypeKind (Ptr ()) (Ptr ())
getTypeKind (Type k _ _) = k
getCursorType :: Cursor -> IO Type
getCursorType gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getCursorType k p1 p2 p3
>>= \ gc_result ->
access_prim_getCursorType_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getCursorType_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getCursorType_gc_res4 gc_result >>= \ gc_res4 ->
let gc_res1 = (unmarshall_TypeKind (gc_res2)) in
(return ((Type gc_res1 gc_res3 gc_res4)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCursorType" prim_getCursorType :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorType_gc_res2 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorType_gc_res3 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorType_gc_res4 :: Ptr a1 -> IO (Ptr r1)
equalTypes :: Type -> Type -> IO Bool
equalTypes gc_arg1 gc_arg3 =
case gc_arg1 of { (Type gc_arg2 p1 p2) ->
case (marshall_TypeKind gc_arg2) of { k ->
case gc_arg3 of { (Type gc_arg4 p12 p22) ->
case (marshall_TypeKind gc_arg4) of { k2 ->
prim_equalTypes k p1 p2 k2 p12 p22
>>= \ r ->
(unmarshall_bool_ r) >>= \ gc_res1 ->
(return (gc_res1))}}}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_equalTypes" prim_equalTypes :: Int -> Ptr a2 -> Ptr a3 -> Int -> Ptr a5 -> Ptr a6 -> IO (Int)
getCanonicalType :: Type -> IO Type
getCanonicalType gc_arg1 =
case gc_arg1 of { (Type gc_arg2 p1 p2) ->
case (marshall_TypeKind gc_arg2) of { k ->
prim_getCanonicalType k p1 p2
>>= \ gc_result ->
access_prim_getCanonicalType_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getCanonicalType_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getCanonicalType_gc_res4 gc_result >>= \ gc_res4 ->
let gc_res1 = (unmarshall_TypeKind (gc_res2)) in
(return ((Type gc_res1 gc_res3 gc_res4)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCanonicalType" prim_getCanonicalType :: Int -> Ptr a2 -> Ptr a3 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCanonicalType_gc_res2 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCanonicalType_gc_res3 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCanonicalType_gc_res4 :: Ptr a1 -> IO (Ptr r1)
isConstQualifiedType :: Type -> IO Bool
isConstQualifiedType gc_arg1 =
case gc_arg1 of { (Type gc_arg2 p1 p2) ->
case (marshall_TypeKind gc_arg2) of { k ->
prim_isConstQualifiedType k p1 p2
>>= \ r ->
(unmarshall_bool_ r) >>= \ gc_res1 ->
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_isConstQualifiedType" prim_isConstQualifiedType :: Int -> Ptr a2 -> Ptr a3 -> IO (Int)
isVolatileQualifiedType :: Type -> IO Bool
isVolatileQualifiedType gc_arg1 =
case gc_arg1 of { (Type gc_arg2 p1 p2) ->
case (marshall_TypeKind gc_arg2) of { k ->
prim_isVolatileQualifiedType k p1 p2
>>= \ r ->
(unmarshall_bool_ r) >>= \ gc_res1 ->
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_isVolatileQualifiedType" prim_isVolatileQualifiedType :: Int -> Ptr a2 -> Ptr a3 -> IO (Int)
isRestrictQualifiedType :: Type -> IO Bool
isRestrictQualifiedType gc_arg1 =
case gc_arg1 of { (Type gc_arg2 p1 p2) ->
case (marshall_TypeKind gc_arg2) of { k ->
prim_isRestrictQualifiedType k p1 p2
>>= \ r ->
(unmarshall_bool_ r) >>= \ gc_res1 ->
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_isRestrictQualifiedType" prim_isRestrictQualifiedType :: Int -> Ptr a2 -> Ptr a3 -> IO (Int)
getPointeeType :: Type -> IO Type
getPointeeType gc_arg1 =
case gc_arg1 of { (Type gc_arg2 p1 p2) ->
case (marshall_TypeKind gc_arg2) of { k ->
prim_getPointeeType k p1 p2
>>= \ gc_result ->
access_prim_getPointeeType_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getPointeeType_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getPointeeType_gc_res4 gc_result >>= \ gc_res4 ->
let gc_res1 = (unmarshall_TypeKind (gc_res2)) in
(return ((Type gc_res1 gc_res3 gc_res4)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getPointeeType" prim_getPointeeType :: Int -> Ptr a2 -> Ptr a3 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getPointeeType_gc_res2 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getPointeeType_gc_res3 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getPointeeType_gc_res4 :: Ptr a1 -> IO (Ptr r1)
getTypeDeclaration :: Type -> IO Cursor
getTypeDeclaration gc_arg1 =
case gc_arg1 of { (Type gc_arg2 p1 p2) ->
case (marshall_TypeKind gc_arg2) of { k ->
prim_getTypeDeclaration k p1 p2
>>= \ gc_result ->
access_prim_getTypeDeclaration_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getTypeDeclaration_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getTypeDeclaration_gc_res4 gc_result >>= \ gc_res4 ->
access_prim_getTypeDeclaration_gc_res5 gc_result >>= \ gc_res5 ->
let gc_res1 = (unmarshall_CursorKind (gc_res2)) in
(return ((Cursor gc_res1 gc_res3 gc_res4 gc_res5)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getTypeDeclaration" prim_getTypeDeclaration :: Int -> Ptr a2 -> Ptr a3 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getTypeDeclaration_gc_res2 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getTypeDeclaration_gc_res3 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getTypeDeclaration_gc_res4 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getTypeDeclaration_gc_res5 :: Ptr a1 -> IO (Ptr r1)
getDeclObjCTypeEncoding :: Cursor -> IO CXString
getDeclObjCTypeEncoding gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getDeclObjCTypeEncoding k p1 p2 p3
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getDeclObjCTypeEncoding" prim_getDeclObjCTypeEncoding :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Ptr r1)
getTypeKindSpelling :: TypeKind -> IO CXString
getTypeKindSpelling gc_arg1 =
case (marshall_TypeKind gc_arg1) of { tk ->
prim_getTypeKindSpelling tk
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getTypeKindSpelling" prim_getTypeKindSpelling :: Int -> IO (Ptr r1)
getResultType :: Type -> IO Type
getResultType gc_arg1 =
case gc_arg1 of { (Type gc_arg2 p1 p2) ->
case (marshall_TypeKind gc_arg2) of { k ->
prim_getResultType k p1 p2
>>= \ gc_result ->
access_prim_getResultType_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getResultType_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getResultType_gc_res4 gc_result >>= \ gc_res4 ->
let gc_res1 = (unmarshall_TypeKind (gc_res2)) in
(return ((Type gc_res1 gc_res3 gc_res4)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getResultType" prim_getResultType :: Int -> Ptr a2 -> Ptr a3 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getResultType_gc_res2 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getResultType_gc_res3 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getResultType_gc_res4 :: Ptr a1 -> IO (Ptr r1)
getCursorResultType :: Cursor -> IO Type
getCursorResultType gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getCursorResultType k p1 p2 p3
>>= \ gc_result ->
access_prim_getCursorResultType_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getCursorResultType_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getCursorResultType_gc_res4 gc_result >>= \ gc_res4 ->
let gc_res1 = (unmarshall_TypeKind (gc_res2)) in
(return ((Type gc_res1 gc_res3 gc_res4)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCursorResultType" prim_getCursorResultType :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorResultType_gc_res2 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorResultType_gc_res3 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorResultType_gc_res4 :: Ptr a1 -> IO (Ptr r1)
isPODType :: Type -> IO Bool
isPODType gc_arg1 =
case gc_arg1 of { (Type gc_arg2 p1 p2) ->
case (marshall_TypeKind gc_arg2) of { k ->
prim_isPODType k p1 p2
>>= \ r ->
(unmarshall_bool_ r) >>= \ gc_res1 ->
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_isPODType" prim_isPODType :: Int -> Ptr a2 -> Ptr a3 -> IO (Int)
isVirtualBase :: Cursor -> IO Bool
isVirtualBase gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_isVirtualBase k p1 p2 p3
>>= \ r ->
(unmarshall_bool_ r) >>= \ gc_res1 ->
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_isVirtualBase" prim_isVirtualBase :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Int)
data CXXAccessSpecifier
= CXXInvalidAccessSpecifier
| CXXPublic
| CXXProtected
| CXXPrivate
deriving (Eq)
marshall_CXXAccessSpecifier :: CXXAccessSpecifier -> Int
marshall_CXXAccessSpecifier arg1 =
case arg1 of {
CXXInvalidAccessSpecifier -> cXXInvalidAccessSpecifier;
CXXPublic -> cXXPublic;
CXXProtected -> cXXProtected;
CXXPrivate -> cXXPrivate
}
unmarshall_CXXAccessSpecifier :: Int -> CXXAccessSpecifier
unmarshall_CXXAccessSpecifier arg1 =
if arg1 == cXXInvalidAccessSpecifier
then CXXInvalidAccessSpecifier
else if arg1 == cXXPublic
then CXXPublic
else if arg1 == cXXProtected
then CXXProtected
else if arg1 == cXXPrivate
then CXXPrivate
else error ("unmarshall_CXXAccessSpecifier: unknown value ("++show arg1++")\n")
cXXInvalidAccessSpecifier :: Int
cXXInvalidAccessSpecifier =
unsafePerformIO(
prim_cXXInvalidAccessSpecifier
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cXXInvalidAccessSpecifier" prim_cXXInvalidAccessSpecifier :: IO (Int)
cXXPublic :: Int
cXXPublic =
unsafePerformIO(
prim_cXXPublic
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cXXPublic" prim_cXXPublic :: IO (Int)
cXXProtected :: Int
cXXProtected =
unsafePerformIO(
prim_cXXProtected
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cXXProtected" prim_cXXProtected :: IO (Int)
cXXPrivate :: Int
cXXPrivate =
unsafePerformIO(
prim_cXXPrivate
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_cXXPrivate" prim_cXXPrivate :: IO (Int)
getCXXAccessSpecifier :: Cursor -> IO CXXAccessSpecifier
getCXXAccessSpecifier gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getCXXAccessSpecifier k p1 p2 p3
>>= \ r ->
let gc_res1 = (unmarshall_CXXAccessSpecifier (r)) in
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCXXAccessSpecifier" prim_getCXXAccessSpecifier :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Int)
getNumOverloadedDecls :: Cursor -> IO Int
getNumOverloadedDecls gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getNumOverloadedDecls k p1 p2 p3
>>= \ r ->
(return (r))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getNumOverloadedDecls" prim_getNumOverloadedDecls :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Int)
getOverloadedDecl :: Cursor -> Int -> IO Cursor
getOverloadedDecl gc_arg1 i =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getOverloadedDecl k p1 p2 p3 i
>>= \ gc_result ->
access_prim_getOverloadedDecl_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getOverloadedDecl_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getOverloadedDecl_gc_res4 gc_result >>= \ gc_res4 ->
access_prim_getOverloadedDecl_gc_res5 gc_result >>= \ gc_res5 ->
let gc_res1 = (unmarshall_CursorKind (gc_res2)) in
(return ((Cursor gc_res1 gc_res3 gc_res4 gc_res5)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getOverloadedDecl" prim_getOverloadedDecl :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> Int -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getOverloadedDecl_gc_res2 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getOverloadedDecl_gc_res3 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getOverloadedDecl_gc_res4 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getOverloadedDecl_gc_res5 :: Ptr a1 -> IO (Ptr r1)
getIBOutletCollectionType :: Cursor -> IO Type
getIBOutletCollectionType gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getIBOutletCollectionType k p1 p2 p3
>>= \ gc_result ->
access_prim_getIBOutletCollectionType_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getIBOutletCollectionType_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getIBOutletCollectionType_gc_res4 gc_result >>= \ gc_res4 ->
let gc_res1 = (unmarshall_TypeKind (gc_res2)) in
(return ((Type gc_res1 gc_res3 gc_res4)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getIBOutletCollectionType" prim_getIBOutletCollectionType :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getIBOutletCollectionType_gc_res2 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getIBOutletCollectionType_gc_res3 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getIBOutletCollectionType_gc_res4 :: Ptr a1 -> IO (Ptr r1)
data ChildVisitResult
= ChildVisit_Break
| ChildVisit_Continue
| ChildVisit_Recurse
deriving (Eq)
marshall_ChildVisitResult :: ChildVisitResult -> Int
marshall_ChildVisitResult arg1 =
case arg1 of {
ChildVisit_Break -> childVisit_Break;
ChildVisit_Continue -> childVisit_Continue;
ChildVisit_Recurse -> childVisit_Recurse
}
unmarshall_ChildVisitResult :: Int -> ChildVisitResult
unmarshall_ChildVisitResult arg1 =
if arg1 == childVisit_Break
then ChildVisit_Break
else if arg1 == childVisit_Continue
then ChildVisit_Continue
else if arg1 == childVisit_Recurse
then ChildVisit_Recurse
else error ("unmarshall_ChildVisitResult: unknown value ("++show arg1++")\n")
childVisit_Break :: Int
childVisit_Break =
unsafePerformIO(
prim_childVisit_Break
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_childVisit_Break" prim_childVisit_Break :: IO (Int)
childVisit_Continue :: Int
childVisit_Continue =
unsafePerformIO(
prim_childVisit_Continue
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_childVisit_Continue" prim_childVisit_Continue :: IO (Int)
childVisit_Recurse :: Int
childVisit_Recurse =
unsafePerformIO(
prim_childVisit_Recurse
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_childVisit_Recurse" prim_childVisit_Recurse :: IO (Int)
type ChildVisitorRaw = Int -> Ptr () -> Ptr () -> Ptr () ->
Int -> Ptr () -> Ptr () -> Ptr () -> Ptr () -> IO Int
type ChildVisitor a = Cursor
-> Cursor
-> Maybe a
-> IO (Maybe a, ChildVisitResult)
foreign import ccall "wrapper" wrapChildVisitorRaw :: ChildVisitorRaw -> IO (FunPtr ChildVisitorRaw)
wrapChildVisitor :: (Storable a) => ChildVisitor a -> ChildVisitorRaw
wrapChildVisitor f = \ck cp1 cp2 cp3
pk pp1 pp2 pp3 pd -> do
let child = Cursor (unmarshall_CursorKind ck) cp1 cp2 cp3
parent = Cursor (unmarshall_CursorKind pk) pp1 pp2 pp3
dataPtr = castPtr pd
(rData, vRes) <- if dataPtr == nullPtr
then f child parent Nothing
else peek dataPtr >>= \d -> f child parent (Just d)
maybe (return ()) (poke dataPtr) rData
return (marshall_ChildVisitResult vRes)
visitChildren :: (Storable a, Alloc a) => Cursor -> ChildVisitor a -> Maybe a -> IO (Maybe a, Bool)
visitChildren (Cursor k p1 p2 p3) f d = do
fp <- wrapChildVisitorRaw (wrapChildVisitor f)
pd <- maybe (return nullPtr) allocSet d
retVal <- fromIntegral <$> prim_visitChildren_ (marshall_CursorKind k) p1 p2 p3 (castPtr pd) fp
rData <- if pd == nullPtr
then return Nothing
else peek pd >>= \d -> dealloc pd >> return (Just d)
freeHaskellFunPtr fp
return (rData, retVal == 0)
foreign import ccall safe "FFI_stub_ffi.h prim_visitChildren_" prim_visitChildren_ :: Int -> Ptr () -> Ptr () -> Ptr () -> Ptr () -> FunPtr ChildVisitorRaw -> IO CUInt
getCursorUSR :: Cursor -> IO CXString
getCursorUSR gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getCursorUSR k p1 p2 p3
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCursorUSR" prim_getCursorUSR :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Ptr r1)
constructUSR_ObjCClass :: String -> IO CXString
constructUSR_ObjCClass gc_arg1 =
(marshall_string_ gc_arg1) >>= \ (s) ->
prim_constructUSR_ObjCClass s
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_constructUSR_ObjCClass" prim_constructUSR_ObjCClass :: Ptr a1 -> IO (Ptr r1)
constructUSR_ObjCCategory :: String -> String -> IO CXString
constructUSR_ObjCCategory gc_arg1 gc_arg2 =
(marshall_string_ gc_arg1) >>= \ (s) ->
(marshall_string_ gc_arg2) >>= \ (p) ->
prim_constructUSR_ObjCCategory s p
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_constructUSR_ObjCCategory" prim_constructUSR_ObjCCategory :: Ptr a1 -> Ptr a2 -> IO (Ptr r1)
constructUSR_ObjCProtocol :: String -> IO CXString
constructUSR_ObjCProtocol gc_arg1 =
(marshall_string_ gc_arg1) >>= \ (s) ->
prim_constructUSR_ObjCProtocol s
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_constructUSR_ObjCProtocol" prim_constructUSR_ObjCProtocol :: Ptr a1 -> IO (Ptr r1)
constructUSR_ObjCIvar :: String -> CXString -> IO CXString
constructUSR_ObjCIvar gc_arg1 gc_arg2 =
(marshall_string_ gc_arg1) >>= \ (s) ->
(marshall_cxString gc_arg2) >>= \ (gc_arg3) ->
(marshall_fptr gc_arg3) >>= \ (x) ->
prim_constructUSR_ObjCIvar s x
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_constructUSR_ObjCIvar" prim_constructUSR_ObjCIvar :: Ptr a1 -> Ptr a2 -> IO (Ptr r1)
constructUSR_ObjCMethod :: String -> Bool -> CXString -> IO CXString
constructUSR_ObjCMethod gc_arg1 gc_arg2 gc_arg3 =
(marshall_string_ gc_arg1) >>= \ (s) ->
(marshall_bool_ gc_arg2) >>= \ (b) ->
(marshall_cxString gc_arg3) >>= \ (gc_arg4) ->
(marshall_fptr gc_arg4) >>= \ (x) ->
prim_constructUSR_ObjCMethod s b x
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_constructUSR_ObjCMethod" prim_constructUSR_ObjCMethod :: Ptr a1 -> Int -> Ptr a3 -> IO (Ptr r1)
constructUSR_ObjCProperty :: String -> CXString -> IO CXString
constructUSR_ObjCProperty gc_arg1 gc_arg2 =
(marshall_string_ gc_arg1) >>= \ (s) ->
(marshall_cxString gc_arg2) >>= \ (gc_arg3) ->
(marshall_fptr gc_arg3) >>= \ (x) ->
prim_constructUSR_ObjCProperty s x
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_constructUSR_ObjCProperty" prim_constructUSR_ObjCProperty :: Ptr a1 -> Ptr a2 -> IO (Ptr r1)
getCursorSpelling :: Cursor -> IO CXString
getCursorSpelling gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getCursorSpelling k p1 p2 p3
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCursorSpelling" prim_getCursorSpelling :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Ptr r1)
getCursorDisplayName :: Cursor -> IO CXString
getCursorDisplayName gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getCursorDisplayName k p1 p2 p3
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCursorDisplayName" prim_getCursorDisplayName :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Ptr r1)
getCursorReferenced :: Cursor -> IO Cursor
getCursorReferenced gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getCursorReferenced k p1 p2 p3
>>= \ gc_result ->
access_prim_getCursorReferenced_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getCursorReferenced_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getCursorReferenced_gc_res4 gc_result >>= \ gc_res4 ->
access_prim_getCursorReferenced_gc_res5 gc_result >>= \ gc_res5 ->
let gc_res1 = (unmarshall_CursorKind (gc_res2)) in
(return ((Cursor gc_res1 gc_res3 gc_res4 gc_res5)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCursorReferenced" prim_getCursorReferenced :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorReferenced_gc_res2 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorReferenced_gc_res3 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorReferenced_gc_res4 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorReferenced_gc_res5 :: Ptr a1 -> IO (Ptr r1)
getCursorDefinition :: Cursor -> IO Cursor
getCursorDefinition gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getCursorDefinition k p1 p2 p3
>>= \ gc_result ->
access_prim_getCursorDefinition_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getCursorDefinition_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getCursorDefinition_gc_res4 gc_result >>= \ gc_res4 ->
access_prim_getCursorDefinition_gc_res5 gc_result >>= \ gc_res5 ->
let gc_res1 = (unmarshall_CursorKind (gc_res2)) in
(return ((Cursor gc_res1 gc_res3 gc_res4 gc_res5)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCursorDefinition" prim_getCursorDefinition :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorDefinition_gc_res2 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorDefinition_gc_res3 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorDefinition_gc_res4 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCursorDefinition_gc_res5 :: Ptr a1 -> IO (Ptr r1)
isCursorDefinition :: Cursor -> IO Bool
isCursorDefinition gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_isCursorDefinition k p1 p2 p3
>>= \ r ->
(unmarshall_bool_ r) >>= \ gc_res1 ->
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_isCursorDefinition" prim_isCursorDefinition :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Int)
getCanonicalCursor :: Cursor -> IO Cursor
getCanonicalCursor gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getCanonicalCursor k p1 p2 p3
>>= \ gc_result ->
access_prim_getCanonicalCursor_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getCanonicalCursor_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getCanonicalCursor_gc_res4 gc_result >>= \ gc_res4 ->
access_prim_getCanonicalCursor_gc_res5 gc_result >>= \ gc_res5 ->
let gc_res1 = (unmarshall_CursorKind (gc_res2)) in
(return ((Cursor gc_res1 gc_res3 gc_res4 gc_res5)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCanonicalCursor" prim_getCanonicalCursor :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCanonicalCursor_gc_res2 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCanonicalCursor_gc_res3 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCanonicalCursor_gc_res4 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getCanonicalCursor_gc_res5 :: Ptr a1 -> IO (Ptr r1)
cXXMethod_isStatic :: Cursor -> IO Bool
cXXMethod_isStatic gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_cXXMethod_isStatic k p1 p2 p3
>>= \ r ->
(unmarshall_bool_ r) >>= \ gc_res1 ->
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_cXXMethod_isStatic" prim_cXXMethod_isStatic :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Int)
getTemplateCursorKind :: Cursor -> IO CursorKind
getTemplateCursorKind gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getTemplateCursorKind k p1 p2 p3
>>= \ r ->
let gc_res1 = (unmarshall_CursorKind (r)) in
(return (gc_res1))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getTemplateCursorKind" prim_getTemplateCursorKind :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Int)
getSpecializedCursorTemplate :: Cursor -> IO Cursor
getSpecializedCursorTemplate gc_arg1 =
case gc_arg1 of { (Cursor gc_arg2 p1 p2 p3) ->
case (marshall_CursorKind gc_arg2) of { k ->
prim_getSpecializedCursorTemplate k p1 p2 p3
>>= \ gc_result ->
access_prim_getSpecializedCursorTemplate_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getSpecializedCursorTemplate_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getSpecializedCursorTemplate_gc_res4 gc_result >>= \ gc_res4 ->
access_prim_getSpecializedCursorTemplate_gc_res5 gc_result >>= \ gc_res5 ->
let gc_res1 = (unmarshall_CursorKind (gc_res2)) in
(return ((Cursor gc_res1 gc_res3 gc_res4 gc_res5)))}}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getSpecializedCursorTemplate" prim_getSpecializedCursorTemplate :: Int -> Ptr a2 -> Ptr a3 -> Ptr a4 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getSpecializedCursorTemplate_gc_res2 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getSpecializedCursorTemplate_gc_res3 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getSpecializedCursorTemplate_gc_res4 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getSpecializedCursorTemplate_gc_res5 :: Ptr a1 -> IO (Ptr r1)
data TokenKind
= Token_Punctuation
| Token_Keyword
| Token_Identifier
| Token_Literal
| Token_Comment
deriving (Eq)
marshall_TokenKind :: TokenKind -> Int
marshall_TokenKind arg1 =
case arg1 of {
Token_Punctuation -> token_Punctuation;
Token_Keyword -> token_Keyword;
Token_Identifier -> token_Identifier;
Token_Literal -> token_Literal;
Token_Comment -> token_Comment
}
unmarshall_TokenKind :: Int -> TokenKind
unmarshall_TokenKind arg1 =
if arg1 == token_Punctuation
then Token_Punctuation
else if arg1 == token_Keyword
then Token_Keyword
else if arg1 == token_Identifier
then Token_Identifier
else if arg1 == token_Literal
then Token_Literal
else if arg1 == token_Comment
then Token_Comment
else error ("unmarshall_TokenKind: unknown value ("++show arg1++")\n")
token_Punctuation :: Int
token_Punctuation =
unsafePerformIO(
prim_token_Punctuation
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_token_Punctuation" prim_token_Punctuation :: IO (Int)
token_Keyword :: Int
token_Keyword =
unsafePerformIO(
prim_token_Keyword
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_token_Keyword" prim_token_Keyword :: IO (Int)
token_Identifier :: Int
token_Identifier =
unsafePerformIO(
prim_token_Identifier
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_token_Identifier" prim_token_Identifier :: IO (Int)
token_Literal :: Int
token_Literal =
unsafePerformIO(
prim_token_Literal
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_token_Literal" prim_token_Literal :: IO (Int)
token_Comment :: Int
token_Comment =
unsafePerformIO(
prim_token_Comment
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_token_Comment" prim_token_Comment :: IO (Int)
data Token = Token Int Int Int Int (Ptr ())
getTokenKind :: Token -> IO TokenKind
getTokenKind gc_arg1 =
case gc_arg1 of { (Token w x y z p) ->
prim_getTokenKind w x y z p
>>= \ r ->
let gc_res1 = (unmarshall_TokenKind (r)) in
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getTokenKind" prim_getTokenKind :: Int -> Int -> Int -> Int -> Ptr a5 -> IO (Int)
getTokenSpelling :: TranslationUnit -> Token -> IO CXString
getTokenSpelling t gc_arg1 =
case gc_arg1 of { (Token w x y z p) ->
prim_getTokenSpelling t w x y z p
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getTokenSpelling" prim_getTokenSpelling :: Ptr a1 -> Int -> Int -> Int -> Int -> Ptr a6 -> IO (Ptr r1)
getTokenLocation :: TranslationUnit -> Token -> IO SourceLocation
getTokenLocation t gc_arg1 =
case gc_arg1 of { (Token w x y z p) ->
prim_getTokenLocation t w x y z p
>>= \ gc_result ->
access_prim_getTokenLocation_gc_res1 gc_result >>= \ gc_res1 ->
access_prim_getTokenLocation_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getTokenLocation_gc_res3 gc_result >>= \ gc_res3 ->
(return ((SourceLocation gc_res1 gc_res2 gc_res3)))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getTokenLocation" prim_getTokenLocation :: Ptr a1 -> Int -> Int -> Int -> Int -> Ptr a6 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getTokenLocation_gc_res1 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getTokenLocation_gc_res2 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getTokenLocation_gc_res3 :: Ptr a1 -> IO (Int)
getTokenExtent :: TranslationUnit -> Token -> IO SourceRange
getTokenExtent t gc_arg1 =
case gc_arg1 of { (Token w x y z p) ->
prim_getTokenExtent t w x y z p
>>= \ gc_result ->
access_prim_getTokenExtent_gc_res1 gc_result >>= \ gc_res1 ->
access_prim_getTokenExtent_gc_res2 gc_result >>= \ gc_res2 ->
access_prim_getTokenExtent_gc_res3 gc_result >>= \ gc_res3 ->
access_prim_getTokenExtent_gc_res4 gc_result >>= \ gc_res4 ->
(return ((SourceRange gc_res1 gc_res2 gc_res3 gc_res4)))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getTokenExtent" prim_getTokenExtent :: Ptr a1 -> Int -> Int -> Int -> Int -> Ptr a6 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getTokenExtent_gc_res1 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getTokenExtent_gc_res2 :: Ptr a1 -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getTokenExtent_gc_res3 :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_getTokenExtent_gc_res4 :: Ptr a1 -> IO (Int)
type TokenList = [Token]
foreign import ccall unsafe "FFI_stub_ffi.h tokenListGetInt" tokenListGetInt_ :: Ptr () -> CInt -> CInt -> IO CInt
foreign import ccall unsafe "FFI_stub_ffi.h tokenListGetPtr" tokenListGetPtr_ :: Ptr () -> CInt -> IO (Ptr ())
foreign import ccall unsafe "FFI_stub_ffi.h makeTokens" makeTokens_ :: CInt -> IO (Ptr ())
foreign import ccall unsafe "FFI_stub_ffi.h &freeTokens" freeTokens_ :: FunPtr (Ptr () -> IO ())
foreign import ccall unsafe "FFI_stub_ffi.h setTokenList" setTokenList_ ::
Ptr () -> CInt -> CInt -> CInt -> CInt -> CInt -> Ptr () -> IO ()
foreign import ccall unsafe "FFI_stub_ffi.h clang_disposeTokens" clang_disposeTokens :: Ptr TranslationUnitObj -> Ptr () -> CUInt -> IO ()
unmarshall_tokenList :: Ptr TranslationUnitObj -> Int -> Ptr () -> IO TokenList
unmarshall_tokenList t numO os = do
tokens <- mapM getToken_ [0..nO]
clang_disposeTokens t os (fromIntegral numO)
return tokens
where nO = fromIntegral (numO1)
getToken_ i = do
i1 <- fromIntegral <$> tokenListGetInt_ os i 0
i2 <- fromIntegral <$> tokenListGetInt_ os i 1
i3 <- fromIntegral <$> tokenListGetInt_ os i 2
i4 <- fromIntegral <$> tokenListGetInt_ os i 3
p <- tokenListGetPtr_ os i
return $ Token i1 i2 i3 i4 p
marshall_tokenList :: TokenList -> IO (Int, ForeignPtr ())
marshall_tokenList ts = do
let numTs = length ts
ci = fromIntegral
setToken tptr ((Token w x y z p), i) = setTokenList_ tptr (ci i) (ci w) (ci x) (ci y) (ci z) p
fillTokens p = mapM_ (setToken p) $ zip ts [0..(numTs1)]
tlist <- newForeignPtr freeTokens_ =<< makeTokens_ (ci numTs)
withForeignPtr tlist fillTokens
return (numTs, tlist)
tokenize :: TranslationUnit -> SourceRange -> IO TokenList
tokenize t gc_arg1 =
case gc_arg1 of { (SourceRange p1 p2 d1 d2) ->
prim_tokenize t p1 p2 d1 d2
>>= \ gc_result ->
access_prim_tokenize_numTokens gc_result >>= \ numTokens ->
access_prim_tokenize_tokens gc_result >>= \ tokens ->
(unmarshall_tokenList t numTokens tokens) >>= \ gc_res1 ->
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_tokenize" prim_tokenize :: Ptr a1 -> Ptr a2 -> Ptr a3 -> Int -> Int -> IO (Ptr r1)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_tokenize_numTokens :: Ptr a1 -> IO (Int)
foreign import ccall unsafe "FFI_stub_ffi.h" access_prim_tokenize_tokens :: Ptr a1 -> IO (Ptr r1)
unmarshall_cursorListExt :: Int -> Ptr () -> IO CursorList
unmarshall_cursorListExt numO os = do
cursors <- mapM getCursor_ [0..nO]
clang_disposeOverriddenCursors os
return cursors
where nO = fromIntegral (numO1)
getCursor_ i = do
kind <- unmarshall_CursorKind <$> (cursorListGetKind_ os i)
p1 <- cursorListGetPtr_ os i 0
p2 <- cursorListGetPtr_ os i 1
p3 <- cursorListGetPtr_ os i 2
return $ Cursor kind p1 p2 p3
annotateTokens :: TranslationUnit -> TokenList -> IO CursorList
annotateTokens t gc_arg1 =
(marshall_tokenList gc_arg1) >>= \ (gc_arg2) ->
case gc_arg2 of { (nts,gc_arg3) ->
(marshall_fptr gc_arg3) >>= \ (ts) ->
prim_annotateTokens t nts ts
>>= \ cs ->
(unmarshall_cursorListExt nts cs) >>= \ gc_res1 ->
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_annotateTokens" prim_annotateTokens :: Ptr a1 -> Int -> Ptr a3 -> IO (Ptr r1)
getCursorKindSpelling :: CursorKind -> IO CXString
getCursorKindSpelling gc_arg1 =
case (marshall_CursorKind gc_arg1) of { k ->
prim_getCursorKindSpelling k
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCursorKindSpelling" prim_getCursorKindSpelling :: Int -> IO (Ptr r1)
foreign import ccall unsafe "clang-c/Index.h clang_enableStackTraces" enableStackTraces :: IO ()
newtype CompletionString = CompletionString (Ptr ())
data CompletionResult = CompletionResult CursorKind CompletionString
data CompletionChunkKind
= CompletionChunk_Optional
| CompletionChunk_TypedText
| CompletionChunk_Text
| CompletionChunk_Placeholder
| CompletionChunk_Informative
| CompletionChunk_CurrentParameter
| CompletionChunk_LeftParen
| CompletionChunk_RightParen
| CompletionChunk_LeftBracket
| CompletionChunk_RightBracket
| CompletionChunk_LeftBrace
| CompletionChunk_RightBrace
| CompletionChunk_LeftAngle
| CompletionChunk_RightAngle
| CompletionChunk_Comma
| CompletionChunk_ResultType
| CompletionChunk_Colon
| CompletionChunk_SemiColon
| CompletionChunk_Equal
| CompletionChunk_HorizontalSpace
| CompletionChunk_VerticalSpace
deriving (Eq)
marshall_CompletionChunkKind :: CompletionChunkKind -> Int
marshall_CompletionChunkKind arg1 =
case arg1 of {
CompletionChunk_Optional -> completionChunk_Optional;
CompletionChunk_TypedText -> completionChunk_TypedText;
CompletionChunk_Text -> completionChunk_Text;
CompletionChunk_Placeholder -> completionChunk_Placeholder;
CompletionChunk_Informative -> completionChunk_Informative;
CompletionChunk_CurrentParameter -> completionChunk_CurrentParameter;
CompletionChunk_LeftParen -> completionChunk_LeftParen;
CompletionChunk_RightParen -> completionChunk_RightParen;
CompletionChunk_LeftBracket -> completionChunk_LeftBracket;
CompletionChunk_RightBracket -> completionChunk_RightBracket;
CompletionChunk_LeftBrace -> completionChunk_LeftBrace;
CompletionChunk_RightBrace -> completionChunk_RightBrace;
CompletionChunk_LeftAngle -> completionChunk_LeftAngle;
CompletionChunk_RightAngle -> completionChunk_RightAngle;
CompletionChunk_Comma -> completionChunk_Comma;
CompletionChunk_ResultType -> completionChunk_ResultType;
CompletionChunk_Colon -> completionChunk_Colon;
CompletionChunk_SemiColon -> completionChunk_SemiColon;
CompletionChunk_Equal -> completionChunk_Equal;
CompletionChunk_HorizontalSpace -> completionChunk_HorizontalSpace;
CompletionChunk_VerticalSpace -> completionChunk_VerticalSpace
}
unmarshall_CompletionChunkKind :: Int -> CompletionChunkKind
unmarshall_CompletionChunkKind arg1 =
if arg1 == completionChunk_Optional
then CompletionChunk_Optional
else if arg1 == completionChunk_TypedText
then CompletionChunk_TypedText
else if arg1 == completionChunk_Text
then CompletionChunk_Text
else if arg1 == completionChunk_Placeholder
then CompletionChunk_Placeholder
else if arg1 == completionChunk_Informative
then CompletionChunk_Informative
else if arg1 == completionChunk_CurrentParameter
then CompletionChunk_CurrentParameter
else if arg1 == completionChunk_LeftParen
then CompletionChunk_LeftParen
else if arg1 == completionChunk_RightParen
then CompletionChunk_RightParen
else if arg1 == completionChunk_LeftBracket
then CompletionChunk_LeftBracket
else if arg1 == completionChunk_RightBracket
then CompletionChunk_RightBracket
else if arg1 == completionChunk_LeftBrace
then CompletionChunk_LeftBrace
else if arg1 == completionChunk_RightBrace
then CompletionChunk_RightBrace
else if arg1 == completionChunk_LeftAngle
then CompletionChunk_LeftAngle
else if arg1 == completionChunk_RightAngle
then CompletionChunk_RightAngle
else if arg1 == completionChunk_Comma
then CompletionChunk_Comma
else if arg1 == completionChunk_ResultType
then CompletionChunk_ResultType
else if arg1 == completionChunk_Colon
then CompletionChunk_Colon
else if arg1 == completionChunk_SemiColon
then CompletionChunk_SemiColon
else if arg1 == completionChunk_Equal
then CompletionChunk_Equal
else if arg1 == completionChunk_HorizontalSpace
then CompletionChunk_HorizontalSpace
else if arg1 == completionChunk_VerticalSpace
then CompletionChunk_VerticalSpace
else error ("unmarshall_CompletionChunkKind: unknown value ("++show arg1++")\n")
completionChunk_Optional :: Int
completionChunk_Optional =
unsafePerformIO(
prim_completionChunk_Optional
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_Optional" prim_completionChunk_Optional :: IO (Int)
completionChunk_TypedText :: Int
completionChunk_TypedText =
unsafePerformIO(
prim_completionChunk_TypedText
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_TypedText" prim_completionChunk_TypedText :: IO (Int)
completionChunk_Text :: Int
completionChunk_Text =
unsafePerformIO(
prim_completionChunk_Text
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_Text" prim_completionChunk_Text :: IO (Int)
completionChunk_Placeholder :: Int
completionChunk_Placeholder =
unsafePerformIO(
prim_completionChunk_Placeholder
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_Placeholder" prim_completionChunk_Placeholder :: IO (Int)
completionChunk_Informative :: Int
completionChunk_Informative =
unsafePerformIO(
prim_completionChunk_Informative
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_Informative" prim_completionChunk_Informative :: IO (Int)
completionChunk_CurrentParameter :: Int
completionChunk_CurrentParameter =
unsafePerformIO(
prim_completionChunk_CurrentParameter
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_CurrentParameter" prim_completionChunk_CurrentParameter :: IO (Int)
completionChunk_LeftParen :: Int
completionChunk_LeftParen =
unsafePerformIO(
prim_completionChunk_LeftParen
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_LeftParen" prim_completionChunk_LeftParen :: IO (Int)
completionChunk_RightParen :: Int
completionChunk_RightParen =
unsafePerformIO(
prim_completionChunk_RightParen
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_RightParen" prim_completionChunk_RightParen :: IO (Int)
completionChunk_LeftBracket :: Int
completionChunk_LeftBracket =
unsafePerformIO(
prim_completionChunk_LeftBracket
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_LeftBracket" prim_completionChunk_LeftBracket :: IO (Int)
completionChunk_RightBracket :: Int
completionChunk_RightBracket =
unsafePerformIO(
prim_completionChunk_RightBracket
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_RightBracket" prim_completionChunk_RightBracket :: IO (Int)
completionChunk_LeftBrace :: Int
completionChunk_LeftBrace =
unsafePerformIO(
prim_completionChunk_LeftBrace
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_LeftBrace" prim_completionChunk_LeftBrace :: IO (Int)
completionChunk_RightBrace :: Int
completionChunk_RightBrace =
unsafePerformIO(
prim_completionChunk_RightBrace
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_RightBrace" prim_completionChunk_RightBrace :: IO (Int)
completionChunk_LeftAngle :: Int
completionChunk_LeftAngle =
unsafePerformIO(
prim_completionChunk_LeftAngle
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_LeftAngle" prim_completionChunk_LeftAngle :: IO (Int)
completionChunk_RightAngle :: Int
completionChunk_RightAngle =
unsafePerformIO(
prim_completionChunk_RightAngle
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_RightAngle" prim_completionChunk_RightAngle :: IO (Int)
completionChunk_Comma :: Int
completionChunk_Comma =
unsafePerformIO(
prim_completionChunk_Comma
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_Comma" prim_completionChunk_Comma :: IO (Int)
completionChunk_ResultType :: Int
completionChunk_ResultType =
unsafePerformIO(
prim_completionChunk_ResultType
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_ResultType" prim_completionChunk_ResultType :: IO (Int)
completionChunk_Colon :: Int
completionChunk_Colon =
unsafePerformIO(
prim_completionChunk_Colon
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_Colon" prim_completionChunk_Colon :: IO (Int)
completionChunk_SemiColon :: Int
completionChunk_SemiColon =
unsafePerformIO(
prim_completionChunk_SemiColon
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_SemiColon" prim_completionChunk_SemiColon :: IO (Int)
completionChunk_Equal :: Int
completionChunk_Equal =
unsafePerformIO(
prim_completionChunk_Equal
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_Equal" prim_completionChunk_Equal :: IO (Int)
completionChunk_HorizontalSpace :: Int
completionChunk_HorizontalSpace =
unsafePerformIO(
prim_completionChunk_HorizontalSpace
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_HorizontalSpace" prim_completionChunk_HorizontalSpace :: IO (Int)
completionChunk_VerticalSpace :: Int
completionChunk_VerticalSpace =
unsafePerformIO(
prim_completionChunk_VerticalSpace
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_completionChunk_VerticalSpace" prim_completionChunk_VerticalSpace :: IO (Int)
getCompletionChunkKind :: CompletionString -> Int -> IO CompletionChunkKind
getCompletionChunkKind gc_arg1 arg2 =
case gc_arg1 of { (CompletionString arg1) ->
prim_getCompletionChunkKind arg1 arg2
>>= \ res1 ->
let gc_res1 = (unmarshall_CompletionChunkKind (res1)) in
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCompletionChunkKind" prim_getCompletionChunkKind :: Ptr a1 -> Int -> IO (Int)
getCompletionChunkText :: CompletionString -> Int -> IO CXString
getCompletionChunkText gc_arg1 i =
case gc_arg1 of { (CompletionString s) ->
prim_getCompletionChunkText s i
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCompletionChunkText" prim_getCompletionChunkText :: Ptr a1 -> Int -> IO (Ptr r1)
getCompletionChunkCompletionString :: CompletionString -> Int -> IO CompletionString
getCompletionChunkCompletionString gc_arg1 arg2 =
case gc_arg1 of { (CompletionString arg1) ->
prim_getCompletionChunkCompletionString arg1 arg2
>>= \ res1 ->
(return ((CompletionString res1)))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCompletionChunkCompletionString" prim_getCompletionChunkCompletionString :: Ptr a1 -> Int -> IO (Ptr r1)
getNumCompletionChunks :: CompletionString -> IO Int
getNumCompletionChunks gc_arg1 =
case gc_arg1 of { (CompletionString arg1) ->
prim_getNumCompletionChunks arg1
>>= \ res1 ->
(return (res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getNumCompletionChunks" prim_getNumCompletionChunks :: Ptr a1 -> IO (Int)
getCompletionPriority :: CompletionString -> IO Int
getCompletionPriority gc_arg1 =
case gc_arg1 of { (CompletionString arg1) ->
prim_getCompletionPriority arg1
>>= \ res1 ->
(return (res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCompletionPriority" prim_getCompletionPriority :: Ptr a1 -> IO (Int)
getCompletionAvailability :: CompletionString -> IO AvailabilityKind
getCompletionAvailability gc_arg1 =
case gc_arg1 of { (CompletionString arg1) ->
prim_getCompletionAvailability arg1
>>= \ res1 ->
let gc_res1 = (unmarshall_AvailabilityKind (res1)) in
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_getCompletionAvailability" prim_getCompletionAvailability :: Ptr a1 -> IO (Int)
data CodeCompleteFlags
= CodeComplete_IncludeMacros
| CodeComplete_IncludeCodePatterns
deriving (Eq)
marshall_CodeCompleteFlags :: CodeCompleteFlags -> Int
marshall_CodeCompleteFlags arg1 =
case arg1 of {
CodeComplete_IncludeMacros -> codeComplete_IncludeMacros;
CodeComplete_IncludeCodePatterns -> codeComplete_IncludeCodePatterns
}
unmarshall_CodeCompleteFlags :: Int -> CodeCompleteFlags
unmarshall_CodeCompleteFlags arg1 =
if arg1 == codeComplete_IncludeMacros
then CodeComplete_IncludeMacros
else if arg1 == codeComplete_IncludeCodePatterns
then CodeComplete_IncludeCodePatterns
else error ("unmarshall_CodeCompleteFlags: unknown value ("++show arg1++")\n")
codeComplete_IncludeMacros :: Int
codeComplete_IncludeMacros =
unsafePerformIO(
prim_codeComplete_IncludeMacros
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_codeComplete_IncludeMacros" prim_codeComplete_IncludeMacros :: IO (Int)
codeComplete_IncludeCodePatterns :: Int
codeComplete_IncludeCodePatterns =
unsafePerformIO(
prim_codeComplete_IncludeCodePatterns
>>= \ res1 ->
(return (res1)))
foreign import ccall unsafe "FFI_stub_ffi.h prim_codeComplete_IncludeCodePatterns" prim_codeComplete_IncludeCodePatterns :: IO (Int)
getCodeCompleteFlagsSum :: [CodeCompleteFlags] -> Int
getCodeCompleteFlagsSum = sum . (map toVal_)
where toVal_ CodeComplete_IncludeMacros = 0x01
toVal_ CodeComplete_IncludeCodePatterns = 0x02
foreign import ccall unsafe "clang-c/Index.h clang_defaultCodeCompleteOptions" defaultCodeCompleteOptions :: IO CInt
data CodeCompleteResultsObj
type CodeCompleteResults = ForeignPtr CodeCompleteResultsObj
foreign import ccall unsafe "FFI_stub_ffi.h &clang_disposeCodeCompleteResults" clang_disposeCodeCompleteResults :: FunPtr (Ptr CodeCompleteResultsObj -> IO ())
unmarshall_codeCompleteResults :: Ptr CodeCompleteResultsObj -> IO (ForeignPtr CodeCompleteResultsObj)
unmarshall_codeCompleteResults = newForeignPtr clang_disposeCodeCompleteResults
codeCompleteAt :: TranslationUnit -> String -> Int -> Int -> [UnsavedFile] -> Int -> IO CodeCompleteResults
codeCompleteAt t gc_arg1 i1 i2 gc_arg2 i3 =
(marshall_string_ gc_arg1) >>= \ (s) ->
(marshall_listLenUnsavedFile gc_arg2) >>= \ (gc_arg3) ->
case gc_arg3 of { (gc_arg4,nufs) ->
(marshall_fptr gc_arg4) >>= \ (ufs) ->
prim_codeCompleteAt t s i1 i2 ufs nufs i3
>>= \ r ->
(unmarshall_codeCompleteResults r) >>= \ gc_res1 ->
(return (gc_res1))}
foreign import ccall unsafe "FFI_stub_ffi.h prim_codeCompleteAt" prim_codeCompleteAt :: Ptr a1 -> Ptr a2 -> Int -> Int -> Ptr a5 -> Int -> Int -> IO (Ptr r1)
sortCodeCompletionResults :: CodeCompleteResults -> Int -> IO ()
sortCodeCompletionResults gc_arg1 i =
(marshall_fptr gc_arg1) >>= \ (c) ->
prim_sortCodeCompletionResults c i
foreign import ccall unsafe "FFI_stub_ffi.h prim_sortCodeCompletionResults" prim_sortCodeCompletionResults :: Ptr a1 -> Int -> IO ()
codeCompleteGetNumDiagnostics :: CodeCompleteResults -> IO Int
codeCompleteGetNumDiagnostics gc_arg1 =
(marshall_fptr gc_arg1) >>= \ (c) ->
prim_codeCompleteGetNumDiagnostics c
>>= \ r ->
(return (r))
foreign import ccall unsafe "FFI_stub_ffi.h prim_codeCompleteGetNumDiagnostics" prim_codeCompleteGetNumDiagnostics :: Ptr a1 -> IO (Int)
codeCompleteGetDiagnostic :: CodeCompleteResults -> Int -> IO Diagnostic
codeCompleteGetDiagnostic gc_arg1 i =
(marshall_fptr gc_arg1) >>= \ (c) ->
prim_codeCompleteGetDiagnostic c i
>>= \ r ->
(unmarshall_diag r) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_codeCompleteGetDiagnostic" prim_codeCompleteGetDiagnostic :: Ptr a1 -> Int -> IO (Ptr r1)
getClangVersion :: IO CXString
getClangVersion =
prim_getClangVersion
>>= \ r ->
(unmarshall_cxString r) >>= \ gc_res1 ->
(return (gc_res1))
foreign import ccall unsafe "FFI_stub_ffi.h prim_getClangVersion" prim_getClangVersion :: IO (Ptr r1)
type InclusionVisitorRaw = File -> Ptr () -> CUInt -> Ptr () -> IO ()
type InclusionVisitor a = File -> [SourceLocation] -> Maybe a -> IO (Maybe a)
getInclusions :: (Storable a, Alloc a) => TranslationUnit -> InclusionVisitor a -> Maybe a -> IO ()
getInclusions t iv d = do
f <- marshall_inclusionVisitor iv
p <- maybe (return nullPtr) allocSet d
prim_getInclusions_ t f (castPtr p)
when (p /= nullPtr) $ dealloc p
freeHaskellFunPtr f
foreign import ccall safe "FFI_stub_ffi.h prim_getInclusions_" prim_getInclusions_ :: Ptr a1 -> FunPtr InclusionVisitorRaw -> Ptr a3 -> IO ()
foreign import ccall "wrapper" wrapInclusionVisitorRaw :: InclusionVisitorRaw -> IO (FunPtr InclusionVisitorRaw)
wrapInclusionVisitor :: (Storable a) => InclusionVisitor a -> InclusionVisitorRaw
wrapInclusionVisitor f = \file pSrcLoc nSrcLoc pData -> do
srcLocs <- unmarshall_SrcLocList pSrcLoc nSrcLoc
let dataPtr = castPtr pData
rdat <- if dataPtr == nullPtr
then f file srcLocs Nothing
else peek dataPtr >>= \dat -> f file srcLocs (Just dat)
maybe (return ()) (poke dataPtr) rdat
marshall_inclusionVisitor :: (Storable a) => InclusionVisitor a -> IO (FunPtr InclusionVisitorRaw)
marshall_inclusionVisitor f = wrapInclusionVisitorRaw (wrapInclusionVisitor f)