module Clang.Internal.FFI
( versionMajor
, versionMinor
, encodedVersion
, Index
, createIndex
, GlobalIndexOptions(..)
, threadBackgroundPriorityForAll
, cXIndex_setGlobalOptions
, cXIndex_getGlobalOptions
, TranslationUnit
, UnsavedFile
, unsavedFilename
, unsavedContents
, newUnsavedFile
, updateUnsavedContents
, AvailabilityKind(..)
, Version(..)
, ClangString
, getString
, getByteString
, unsafeGetByteString
, File(..)
, getFileName
, getFileTime
, UniqueId(..)
, getFileUniqueID
, isFileMultipleIncludeGuarded
, getFile
, SourceLocation
, getNullLocation
, equalLocations
, getLocation
, getLocationForOffset
, location_isInSystemHeader
, location_isFromMainFile
, SourceRange
, getNullRange
, getRange
, equalRanges
, range_isNull
, getExpansionLocation
, getPresumedLocation
, getSpellingLocation
, getFileLocation
, getRangeStart
, getRangeEnd
, Severity(..)
, Diagnostic
, DiagnosticSet
, getNumDiagnosticsInSet
, getDiagnosticInSet
, LoadError(..)
, loadDiagnostics
, getChildDiagnostics
, getNumDiagnostics
, getDiagnostic
, getDiagnosticSetFromTU
, DisplayOptions(..)
, formatDiagnostic
, defaultDiagnosticDisplayOptions
, getDiagnosticSeverity
, getDiagnosticLocation
, getDiagnosticSpelling
, getDiagnosticOption
, getDiagnosticCategory
, getDiagnosticCategoryText
, getDiagnosticNumRanges
, getDiagnosticRange
, getDiagnosticNumFixIts
, getDiagnosticFixIt
, getTranslationUnitSpelling
, createTranslationUnitFromSourceFile
, createTranslationUnit
, TranslationUnitFlags(..)
, defaultEditingTranslationUnitOptions
, parseTranslationUnit
, setClangResourcesPath
, SaveTranslationUnitFlags(..)
, defaultSaveOptions
, saveTranslationUnit
, ReparseFlags(..)
, defaultReparseOptions
, reparseTranslationUnit
, CursorKind(..)
, firstDeclCursor
, lastDeclCursor
, firstRefCursor
, lastRefCursor
, firstInvalidCursor
, lastInvalidCursor
, firstExprCursor
, lastExprCursor
, firstStmtCursor
, lastStmtCursor
, firstAttrCursor
, lastAttrCursor
, firstPreprocessingCursor
, lastPreprocessingCursor
, firstExtraDeclCursor
, lastExtraDeclCursor
, gccAsmStmtCursor
, macroInstantiationCursor
, Comment(..)
, Cursor
, getNullCursor
, getTranslationUnitCursor
, cursor_isNull
, hashCursor
, getCursorKind
, isDeclaration
, isReference
, isExpression
, isStatement
, isAttribute
, isInvalid
, isTranslationUnit
, isPreprocessing
, isUnexposed
, LinkageKind(..)
, getCursorLinkage
, getCursorAvailability
, PlatformAvailability(..)
, PlatformAvailabilityInfo(..)
, getCursorPlatformAvailability
, LanguageKind(..)
, getCursorLanguage
, cursor_getTranslationUnit
, CursorSet
, createCXCursorSet
, cXCursorSet_contains
, cXCursorSet_insert
, getCursorSemanticParent
, getCursorLexicalParent
, getOverriddenCursors
, getIncludedFile
, getCursor
, getCursorLocation
, getCursorSpellingLocation
, getCursorExtent
, TypeKind(..)
, type_FirstBuiltin
, type_LastBuiltin
, CallingConv(..)
, Type
, getTypeKind
, getCursorType
, getTypeSpelling
, getTypedefDeclUnderlyingType
, getEnumDeclIntegerType
, getEnumConstantDeclValue
, getEnumConstantDeclUnsignedValue
, getFieldDeclBitWidth
, cursor_getNumArguments
, cursor_getArgument
, equalTypes
, getCanonicalType
, isConstQualifiedType
, isVolatileQualifiedType
, isRestrictQualifiedType
, getPointeeType
, getTypeDeclaration
, getDeclObjCTypeEncoding
, getTypeKindSpelling
, getFunctionTypeCallingConv
, getResultType
, getNumArgTypes
, getArgType
, isFunctionTypeVariadic
, getCursorResultType
, isPODType
, getElementType
, getNumElements
, getArrayElementType
, getArraySize
, TypeLayoutError(..)
, type_getAlignOf
, type_getClassType
, type_getSizeOf
, type_getOffsetOf
, RefQualifierKind(..)
, type_getCXXRefQualifier
, isBitField
, isVirtualBase
, CXXAccessSpecifier(..)
, getCXXAccessSpecifier
, getNumOverloadedDecls
, getOverloadedDecl
, getIBOutletCollectionType
, CursorList
, getChildren
, getDescendants
, getDeclarations
, getReferences
, getDeclarationsAndReferences
, ParentedCursor(..)
, ParentedCursorList
, getParentedDescendants
, getParentedDeclarations
, getParentedReferences
, getParentedDeclarationsAndReferences
, getCursorUSR
, constructUSR_ObjCClass
, constructUSR_ObjCCategory
, constructUSR_ObjCProtocol
, constructUSR_ObjCIvar
, constructUSR_ObjCMethod
, constructUSR_ObjCProperty
, getCursorSpelling
, cursor_getSpellingNameRange
, getCursorDisplayName
, getCursorReferenced
, getCursorDefinition
, isCursorDefinition
, cursor_isDynamicCall
, getCanonicalCursor
, cursor_getObjCSelectorIndex
, cursor_getReceiverType
, ObjCPropertyAttrKind(..)
, cursor_getObjCPropertyAttributes
, ObjCDeclQualifierKind(..)
, cursor_getObjCDeclQualifiers
, cursor_isObjCOptional
, cursor_isVariadic
, cursor_getCommentRange
, cursor_getRawCommentText
, cursor_getBriefCommentText
, cursor_getParsedComment
, Module(..)
, cursor_getModule
, module_getASTFile
, module_getParent
, module_getName
, module_getFullName
, module_getNumTopLevelHeaders
, module_getTopLevelHeader
, cXXMethod_isPureVirtual
, cXXMethod_isStatic
, cXXMethod_isVirtual
, getTemplateCursorKind
, getSpecializedCursorTemplate
, getCursorReferenceNameRange
, NameRefFlags(..)
, CommentKind(..)
, InlineCommandRenderStyle(..)
, ParamPassDirectionKind(..)
, comment_getKind
, comment_getNumChildren
, comment_getChild
, comment_isWhitespace
, inlineContentComment_hasTrailingNewline
, textComment_getText
, inlineCommandComment_getCommandName
, inlineCommandComment_getRenderKind
, inlineCommandComment_getNumArgs
, inlineCommandComment_getArgText
, hTMLTagComment_getTagName
, hTMLStartTagComment_isSelfClosing
, hTMLStartTag_getNumAttrs
, hTMLStartTag_getAttrName
, hTMLStartTag_getAttrValue
, blockCommandComment_getCommandName
, blockCommandComment_getNumArgs
, blockCommandComment_getArgText
, blockCommandComment_getParagraph
, paramCommandComment_getParamName
, paramCommandComment_isParamIndexValid
, paramCommandComment_getParamIndex
, paramCommandComment_isDirectionExplicit
, paramCommandComment_getDirection
, tParamCommandComment_getParamName
, tParamCommandComment_isParamPositionValid
, tParamCommandComment_getDepth
, tParamCommandComment_getIndex
, verbatimBlockLineComment_getText
, verbatimLineComment_getText
, hTMLTagComment_getAsString
, fullComment_getAsHTML
, fullComment_getAsXML
, TokenKind(..)
, Token
, TokenList
, getTokenKind
, getTokenSpelling
, getTokenLocation
, getTokenExtent
, tokenize
, annotateTokens
, getCursorKindSpelling
, enableStackTraces
, CompletionString
, CompletionResult
, ChunkKind(..)
, getCompletionChunkKind
, getCompletionChunkText
, getCompletionChunkCompletionString
, getNumCompletionChunks
, getCompletionPriority
, getCompletionAvailability
, getCompletionNumAnnotations
, getCompletionAnnotation
, getCompletionParent
, getCompletionBriefComment
, getCursorCompletionString
, CodeCompleteFlags(..)
, defaultCodeCompleteOptions
, CodeCompleteResults
, codeCompleteAt
, codeCompleteGetNumResults
, codeCompleteGetResult
, sortCodeCompletionResults
, codeCompleteGetNumDiagnostics
, codeCompleteGetDiagnostic
, CompletionContext(..)
, codeCompleteGetContexts
, codeCompleteGetContainerKind
, codeCompleteGetContainerUSR
, codeCompleteGetObjCSelector
, getClangVersion
, toggleCrashRecovery
, Inclusion(..)
, InclusionList
, getInclusions
, Remapping
, getRemappings
, getRemappingsFromFileList
, remap_getNumFiles
, remap_getFilenames
) where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.Marshal.Array as C2HSImp
import qualified Foreign.Marshal.Utils as C2HSImp
import qualified Foreign.Ptr as C2HSImp
import qualified Foreign.Storable as C2HSImp
import Control.Monad (forM_)
import Control.Monad.Trans
import qualified Data.ByteString as B
import qualified Data.ByteString.Unsafe as BU
import Data.Hashable
import Data.Typeable (Typeable)
import qualified Data.Vector as DV
import qualified Data.Vector.Storable as DVS
import qualified Data.Vector.Storable.Mutable as DVSM
import Data.Word
import Foreign.C
import Foreign
import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr)
import Unsafe.Coerce (unsafeCoerce)
import System.IO.Unsafe(unsafePerformIO)
import Clang.Internal.BitFlags
import Clang.Internal.FFIConstants
import Clang.Internal.Monad
fromCInt :: Num b => CInt -> b
fromCInt = fromIntegral
toCInt :: Integral a => a -> CInt
toCInt = fromIntegral
versionMajor :: Int
versionMajor = 0
versionMinor :: Int
versionMinor = 20
encodedVersion :: Int
encodedVersion = 0 * 10000 + 20 * 1
newtype Index s = Index { unIndex :: Ptr () }
deriving (Eq, Ord, Typeable)
instance ClangValue Index
mkIndex :: Ptr () -> Index ()
mkIndex = Index
clang_createIndex :: (CInt) -> (CInt) -> IO ((Ptr ()))
clang_createIndex a1 a2 =
let {a1' = fromIntegral a1} in
let {a2' = fromIntegral a2} in
clang_createIndex'_ a1' a2' >>= \res ->
let {res' = id res} in
return (res')
unsafe_createIndex :: Bool -> Bool -> IO (Index ())
unsafe_createIndex a b = clang_createIndex (fromBool a) (fromBool b) >>= return . mkIndex
createIndex :: ClangBase m => Bool -> Bool -> ClangT s m (Index s)
createIndex = (registerIndex .) . unsafe_createIndex
clang_disposeIndex :: (Ptr ()) -> IO ()
clang_disposeIndex a1 =
let {a1' = id a1} in
clang_disposeIndex'_ a1' >>
return ()
disposeIndex :: Index s -> IO ()
disposeIndex index = clang_disposeIndex (unIndex index)
registerIndex :: ClangBase m => IO (Index ()) -> ClangT s m (Index s)
registerIndex action = do
(_, idx) <- clangAllocate (action >>= return . unsafeCoerce)
(\i -> disposeIndex i)
return idx
data GlobalIndexOptions = DefaultGlobalIndexOptions
| ThreadBackgroundPriorityForIndexing
| ThreadBackgroundPriorityForEditing
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum GlobalIndexOptions where
succ DefaultGlobalIndexOptions = ThreadBackgroundPriorityForIndexing
succ ThreadBackgroundPriorityForIndexing = ThreadBackgroundPriorityForEditing
succ ThreadBackgroundPriorityForEditing = error "GlobalIndexOptions.succ: ThreadBackgroundPriorityForEditing has no successor"
pred ThreadBackgroundPriorityForIndexing = DefaultGlobalIndexOptions
pred ThreadBackgroundPriorityForEditing = ThreadBackgroundPriorityForIndexing
pred DefaultGlobalIndexOptions = error "GlobalIndexOptions.pred: DefaultGlobalIndexOptions has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from ThreadBackgroundPriorityForEditing
fromEnum DefaultGlobalIndexOptions = 0
fromEnum ThreadBackgroundPriorityForIndexing = 1
fromEnum ThreadBackgroundPriorityForEditing = 2
toEnum 0 = DefaultGlobalIndexOptions
toEnum 1 = ThreadBackgroundPriorityForIndexing
toEnum 2 = ThreadBackgroundPriorityForEditing
toEnum unmatched = error ("GlobalIndexOptions.toEnum: Cannot match " ++ show unmatched)
instance BitFlags GlobalIndexOptions where
toBit DefaultGlobalIndexOptions = 0x0
toBit ThreadBackgroundPriorityForIndexing = 0x1
toBit ThreadBackgroundPriorityForEditing = 0x2
threadBackgroundPriorityForAll :: [GlobalIndexOptions]
threadBackgroundPriorityForAll = [ThreadBackgroundPriorityForEditing,
ThreadBackgroundPriorityForIndexing]
clang_CXIndex_setGlobalOptions :: (Ptr ()) -> (Int) -> IO ()
clang_CXIndex_setGlobalOptions a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
clang_CXIndex_setGlobalOptions'_ a1' a2' >>
return ()
cXIndex_setGlobalOptions :: Index s -> Int -> IO ()
cXIndex_setGlobalOptions index options = clang_CXIndex_setGlobalOptions (unIndex index) options
clang_CXIndex_getGlobalOptions :: (Ptr ()) -> IO ((Int))
clang_CXIndex_getGlobalOptions a1 =
let {a1' = id a1} in
clang_CXIndex_getGlobalOptions'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
cXIndex_getGlobalOptions :: Index s -> IO Int
cXIndex_getGlobalOptions index = clang_CXIndex_getGlobalOptions (unIndex index)
newtype TranslationUnit s = TranslationUnit { unTranslationUnit :: (Ptr ()) }
deriving (Eq, Ord, Typeable)
instance ClangValue TranslationUnit
mkTranslationUnit :: Ptr () -> TranslationUnit ()
mkTranslationUnit = TranslationUnit
clang_disposeTranslationUnit :: (Ptr ()) -> IO ()
clang_disposeTranslationUnit a1 =
let {a1' = id a1} in
clang_disposeTranslationUnit'_ a1' >>
return ()
disposeTranslationUnit :: TranslationUnit s -> IO ()
disposeTranslationUnit t = clang_disposeTranslationUnit (unTranslationUnit t)
registerTranslationUnit :: ClangBase m => IO (TranslationUnit ())
-> ClangT s m (TranslationUnit s)
registerTranslationUnit action = do
(_, tu) <- clangAllocate (action >>= return . unsafeCoerce)
(\t -> disposeTranslationUnit t)
return tu
data UnsavedFile = UnsavedFile
{ _unsavedFilename :: !B.ByteString
, _unsavedContents :: !B.ByteString
} deriving (Eq, Show, Typeable)
unsavedFilename :: UnsavedFile -> B.ByteString
unsavedFilename = _unsavedFilename
unsavedContents :: UnsavedFile -> B.ByteString
unsavedContents = _unsavedContents
newUnsavedFile :: B.ByteString -> B.ByteString -> UnsavedFile
newUnsavedFile f c = UnsavedFile (nullTerminate f) c
updateUnsavedContents :: UnsavedFile -> B.ByteString -> UnsavedFile
updateUnsavedContents uf c = UnsavedFile (unsavedFilename uf) c
nullTerminate :: B.ByteString -> B.ByteString
nullTerminate bs
| B.null bs = B.singleton 0
| B.last bs == 0 = bs
| otherwise = B.snoc bs 0
withUnsavedFiles :: DV.Vector UnsavedFile -> (Ptr CUnsavedFile -> Int -> IO a) -> IO a
withUnsavedFiles ufs f =
withCUnsavedFiles ufs $ \cufs ->
DVS.unsafeWith cufs $ \ptr ->
f ptr (DVS.length cufs)
data CUnsavedFile = CUnsavedFile
{ cUnsavedFilename :: CString
, cUnsavedContents :: CString
, cUnsavedContentsLen :: CULong
}
instance Storable CUnsavedFile where
sizeOf _ = sizeOfCXUnsavedFile
alignment _ = alignOfCXUnsavedFile
peek p = do
filename <- peekByteOff p offsetCXUnsavedFileFilename
contents <- peekByteOff p offsetCXUnsavedFileContents
contentsLen <- peekByteOff p offsetCXUnsavedFileContentsLen
return $! CUnsavedFile filename contents contentsLen
poke p (CUnsavedFile filename contents contentsLen) = do
pokeByteOff p offsetCXUnsavedFileFilename filename
pokeByteOff p offsetCXUnsavedFileContents contents
pokeByteOff p offsetCXUnsavedFileContentsLen contentsLen
withCUnsavedFiles :: DV.Vector UnsavedFile -> (DVS.Vector CUnsavedFile -> IO a) -> IO a
withCUnsavedFiles ufs f = do
let len = DV.length ufs
v <- DVSM.new len
go v 0 len
where
go v i len
| i == len = f =<< DVS.unsafeFreeze v
| otherwise = do let uf = DV.unsafeIndex ufs i
ufFilename = unsavedFilename uf
ufContents = unsavedContents uf
BU.unsafeUseAsCString ufFilename $ \cufFilename ->
BU.unsafeUseAsCString ufContents $ \cufContents -> do
let contentsLen = fromIntegral $ B.length ufContents
cuf = CUnsavedFile cufFilename cufContents contentsLen
DVSM.write v i cuf
go v (i + 1) len
data AvailabilityKind = Availability_Available
| Availability_Deprecated
| Availability_NotAvailable
| Availability_NotAccessible
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum AvailabilityKind where
succ Availability_Available = Availability_Deprecated
succ Availability_Deprecated = Availability_NotAvailable
succ Availability_NotAvailable = Availability_NotAccessible
succ Availability_NotAccessible = error "AvailabilityKind.succ: Availability_NotAccessible has no successor"
pred Availability_Deprecated = Availability_Available
pred Availability_NotAvailable = Availability_Deprecated
pred Availability_NotAccessible = Availability_NotAvailable
pred Availability_Available = error "AvailabilityKind.pred: Availability_Available has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from Availability_NotAccessible
fromEnum Availability_Available = 0
fromEnum Availability_Deprecated = 1
fromEnum Availability_NotAvailable = 2
fromEnum Availability_NotAccessible = 3
toEnum 0 = Availability_Available
toEnum 1 = Availability_Deprecated
toEnum 2 = Availability_NotAvailable
toEnum 3 = Availability_NotAccessible
toEnum unmatched = error ("AvailabilityKind.toEnum: Cannot match " ++ show unmatched)
data Version = Version
{ majorVersion :: !Int
, minorVersion :: !Int
, subminorVersion :: !Int
} deriving (Eq, Ord, Show, Typeable)
instance Storable Version where
sizeOf _ = sizeOfCXVersion
alignment _ = alignOfCXVersion
peek p = do
major <- fromCInt <$> peekByteOff p offsetCXVersionMajor
minor <- fromCInt <$> peekByteOff p offsetCXVersionMinor
subminor <- fromCInt <$> peekByteOff p offsetCXVersionSubminor
return $! Version major minor subminor
poke p (Version major minor subminor) = do
pokeByteOff p offsetCXVersionMajor major
pokeByteOff p offsetCXVersionMinor minor
pokeByteOff p offsetCXVersionSubminor subminor
data ClangString s = ClangString !(Ptr ()) !Word32
deriving (Eq, Ord, Typeable)
instance ClangValue ClangString
instance Storable (ClangString s) where
sizeOf _ = 12
alignment _ = 8
peek p = do
strData <- (\ptr -> do {C2HSImp.peekByteOff ptr 0 :: IO (C2HSImp.Ptr ())}) p
strFlags <- (\ptr -> do {C2HSImp.peekByteOff ptr 8 :: IO C2HSImp.CUInt}) p
return $! ClangString strData (fromIntegral strFlags)
poke p (ClangString d f) = do
(\ptr val -> do {C2HSImp.pokeByteOff ptr 0 (val :: (C2HSImp.Ptr ()))}) p d
(\ptr val -> do {C2HSImp.pokeByteOff ptr 8 (val :: C2HSImp.CUInt)}) p (fromIntegral f)
instance Hashable (ClangString s) where
hashWithSalt salt (ClangString p f) = (`hashWithSalt` f)
. (`hashWithSalt` pInt)
$ salt
where
pInt = (fromIntegral $ ptrToWordPtr p) :: Int
registerClangString :: ClangBase m => IO (ClangString ()) -> ClangT s m (ClangString s)
registerClangString action = do
(_, str) <- clangAllocate (action >>= return . unsafeCoerce)
(\(ClangString d f) -> freeClangString d f)
return str
freeClangString :: (Ptr ()) -> (Word32) -> IO ()
freeClangString a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
freeClangString'_ a1' a2' >>
return ()
unmarshall_clangString :: Ptr () -> Word32 -> IO (ClangString ())
unmarshall_clangString d f = return $ ClangString d f
getString :: ClangBase m => ClangString s' -> ClangT s m String
getString (ClangString d f) = liftIO $ getCStringPtr d f >>= peekCString
getByteString :: ClangBase m => ClangString s' -> ClangT s m B.ByteString
getByteString (ClangString d f) = liftIO $ getCStringPtr d f >>= B.packCString
unsafeGetByteString :: ClangBase m => ClangString s' -> ClangT s m B.ByteString
unsafeGetByteString (ClangString d f) = liftIO $ getCStringPtr d f >>= BU.unsafePackCString
clang_getCString :: (ClangString a) -> IO ((CString))
clang_getCString a1 =
withVoided a1 $ \a1' ->
clang_getCString'_ a1' >>= \res ->
let {res' = id res} in
return (res')
getCStringPtr :: Ptr () -> Word32 -> IO CString
getCStringPtr d f = clang_getCString (ClangString d f)
newtype File s = File { unFile :: Ptr () }
deriving (Eq, Ord, Typeable)
instance ClangValue File
instance Hashable (File s) where
hashWithSalt salt (File p) = let !pInt = (fromIntegral $ ptrToWordPtr p) :: Int
in hashWithSalt salt pInt
maybeFile :: File s' -> Maybe (File s)
maybeFile (File p) | p == nullPtr = Nothing
maybeFile f = Just (unsafeCoerce f)
unMaybeFile :: Maybe (File s') -> File s
unMaybeFile (Just f) = unsafeCoerce f
unMaybeFile Nothing = File nullPtr
clang_getFileName :: (Ptr ()) -> IO ((Ptr (ClangString ())))
clang_getFileName a1 =
let {a1' = id a1} in
clang_getFileName'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getFileName :: File s -> IO (ClangString ())
unsafe_getFileName x = clang_getFileName (unFile x) >>= peek
getFileName :: ClangBase m => File s' -> ClangT s m (ClangString s)
getFileName = registerClangString . unsafe_getFileName
foreign import ccall unsafe "clang-c/Index.h clang_getFileTime" clang_getFileTime :: Ptr () -> IO CTime
getFileTime :: File s -> IO CTime
getFileTime (File ptr) = clang_getFileTime ptr
data UniqueId = UniqueId !Word64 !Word64 !Word64
deriving (Eq, Ord, Show, Typeable)
instance Hashable UniqueId where
hashWithSalt salt (UniqueId a b c) = (`hashWithSalt` a)
. (`hashWithSalt` b)
. (`hashWithSalt` c)
$ salt
maybeFileUniqueID :: (Int, Word64, Word64, Word64) -> Maybe UniqueId
maybeFileUniqueID (v, d1, d2, d3) | v /= 0 = Nothing
| otherwise = Just $ UniqueId d1 d2 d3
clang_getFileUniqueID :: (Ptr ()) -> (Ptr ()) -> IO ((CInt))
clang_getFileUniqueID a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
clang_getFileUniqueID'_ a1' a2' >>= \res ->
let {res' = id res} in
return (res')
getFileUniqueID :: File s -> IO (Maybe UniqueId)
getFileUniqueID f =
allocaArray 3 (ptrToFileUniqueId f)
where
ptrToFileUniqueId :: File s -> Ptr Word64 -> IO (Maybe UniqueId)
ptrToFileUniqueId f' ptr = do
res' <- clang_getFileUniqueID (unFile f') (castPtr ptr)
ds' <- peekArray 3 ptr
return (maybeFileUniqueID (fromIntegral res', ds' !! 0, ds' !! 1, ds' !! 2))
clang_isFileMultipleIncludeGuarded :: (Ptr ()) -> (Ptr ()) -> IO ((CInt))
clang_isFileMultipleIncludeGuarded a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
clang_isFileMultipleIncludeGuarded'_ a1' a2' >>= \res ->
let {res' = fromIntegral res} in
return (res')
isFileMultipleIncludeGuarded :: TranslationUnit s -> File s' -> IO Bool
isFileMultipleIncludeGuarded t f = clang_isFileMultipleIncludeGuarded (unTranslationUnit t) (unFile f) >>= return . (toBool :: Int -> Bool) . fromIntegral
clang_getFile :: (Ptr ()) -> (CString) -> IO ((Ptr ()))
clang_getFile a1 a2 =
let {a1' = id a1} in
(flip ($)) a2 $ \a2' ->
clang_getFile'_ a1' a2' >>= \res ->
let {res' = id res} in
return (res')
getFile:: Proxy s -> TranslationUnit s' -> String -> IO (File s)
getFile _ t s = withCString s (\cs -> clang_getFile (unTranslationUnit t) cs >>= return . File)
data SourceLocation s = SourceLocation !(Ptr ()) !(Ptr ()) !Int
deriving (Ord, Typeable)
instance ClangValue SourceLocation
instance Eq (SourceLocation s) where
a == b = unsafePerformIO $ equalLocations a b
instance Storable (SourceLocation s) where
sizeOf _ = sizeOfCXSourceLocation
alignment _ = alignOfCXSourceLocation
peek p = do
ptrArray <- (\ptr -> do {return $ ptr `C2HSImp.plusPtr` 0 :: IO (C2HSImp.Ptr (C2HSImp.Ptr ()))}) p >>= peekArray 2
intData <- (\ptr -> do {C2HSImp.peekByteOff ptr 16 :: IO C2HSImp.CUInt}) p
return $! SourceLocation (ptrArray !! 0) (ptrArray !! 1) (fromIntegral intData)
poke p (SourceLocation p0 p1 i )= do
ptrsArray <- mallocArray 2
pokeArray ptrsArray [p0,p1]
(\ptr val -> do {C2HSImp.copyArray (ptr `C2HSImp.plusPtr` 0) (val :: (C2HSImp.Ptr (C2HSImp.Ptr ()))) 2}) p (castPtr ptrsArray)
(\ptr val -> do {C2HSImp.pokeByteOff ptr 16 (val :: C2HSImp.CUInt)}) p (fromIntegral i)
data SourceRange s = SourceRange !(Ptr ()) !(Ptr ()) !Int !Int
deriving (Ord, Typeable)
instance ClangValue SourceRange
instance Eq (SourceRange s) where
a == b = unsafePerformIO $ equalRanges a b
instance Storable (SourceRange s) where
sizeOf _ = sizeOfCXSourceRange
alignment _ = alignOfCXSourceRange
peek p = do
ptrArray <- (\ptr -> do {return $ ptr `C2HSImp.plusPtr` 0 :: IO (C2HSImp.Ptr (C2HSImp.Ptr ()))}) p >>= peekArray 2
beginIntData <- (\ptr -> do {C2HSImp.peekByteOff ptr 16 :: IO C2HSImp.CUInt}) p
endIntData <- (\ptr -> do {C2HSImp.peekByteOff ptr 20 :: IO C2HSImp.CUInt}) p
return $! SourceRange (ptrArray !! 0) (ptrArray !! 1) (fromIntegral beginIntData) (fromIntegral endIntData)
poke p (SourceRange p0 p1 begin end)= do
ptrsArray <- mallocArray 2
pokeArray ptrsArray [p0,p1]
(\ptr val -> do {C2HSImp.copyArray (ptr `C2HSImp.plusPtr` 0) (val :: (C2HSImp.Ptr (C2HSImp.Ptr ()))) 2}) p (castPtr ptrsArray)
(\ptr val -> do {C2HSImp.pokeByteOff ptr 16 (val :: C2HSImp.CUInt)}) p (fromIntegral begin)
(\ptr val -> do {C2HSImp.pokeByteOff ptr 20 (val :: C2HSImp.CUInt)}) p (fromIntegral end)
clang_getNullLocation :: IO ((Ptr (SourceLocation s)))
clang_getNullLocation =
clang_getNullLocation'_ >>= \res ->
let {res' = castPtr res} in
return (res')
getNullLocation :: Proxy s -> IO (SourceLocation s)
getNullLocation _ = clang_getNullLocation >>= peek
withVoided :: Storable a => a -> (Ptr () -> IO c) -> IO c
withVoided a f= with a (\aPtr -> f (castPtr aPtr))
clang_equalLocations :: (SourceLocation a) -> (SourceLocation b) -> IO ((Bool))
clang_equalLocations a1 a2 =
withVoided a1 $ \a1' ->
withVoided a2 $ \a2' ->
clang_equalLocations'_ a1' a2' >>= \res ->
let {res' = toBool res} in
return (res')
equalLocations :: SourceLocation s -> SourceLocation s' -> IO Bool
equalLocations s1 s2 = clang_equalLocations s1 s2
clang_getLocation :: (Ptr ()) -> (Ptr ()) -> (Int) -> (Int) -> IO ((Ptr (SourceLocation s)))
clang_getLocation a1 a2 a3 a4 =
let {a1' = id a1} in
let {a2' = id a2} in
let {a3' = fromIntegral a3} in
let {a4' = fromIntegral a4} in
clang_getLocation'_ a1' a2' a3' a4' >>= \res ->
let {res' = castPtr res} in
return (res')
getLocation :: Proxy s -> TranslationUnit s' -> File s'' -> Int -> Int -> IO (SourceLocation s)
getLocation _ t f i j = clang_getLocation (unTranslationUnit t) (unFile f) i j >>= peek
clang_getLocationForOffset :: (Ptr ()) -> (Ptr ()) -> (Int) -> IO ((Ptr (SourceLocation s)))
clang_getLocationForOffset a1 a2 a3 =
let {a1' = id a1} in
let {a2' = id a2} in
let {a3' = fromIntegral a3} in
clang_getLocationForOffset'_ a1' a2' a3' >>= \res ->
let {res' = castPtr res} in
return (res')
getLocationForOffset :: Proxy s -> TranslationUnit s' -> File s'' -> Int -> IO (SourceLocation s)
getLocationForOffset _ t f i = clang_getLocationForOffset (unTranslationUnit t) (unFile f) i >>= peek
clang_Location_isInSystemHeader :: (SourceLocation a) -> IO ((Bool))
clang_Location_isInSystemHeader a1 =
withVoided a1 $ \a1' ->
clang_Location_isInSystemHeader'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
location_isInSystemHeader :: SourceLocation s -> IO Bool
location_isInSystemHeader s = clang_Location_isInSystemHeader s
clang_Location_isFromMainFile :: (SourceLocation a) -> IO ((Bool))
clang_Location_isFromMainFile a1 =
withVoided a1 $ \a1' ->
clang_Location_isFromMainFile'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
location_isFromMainFile :: SourceLocation s -> IO Bool
location_isFromMainFile s = clang_Location_isFromMainFile s
clang_getNullRange :: IO ((Ptr (SourceRange s)))
clang_getNullRange =
clang_getNullRange'_ >>= \res ->
let {res' = castPtr res} in
return (res')
getNullRange :: Proxy s -> IO (SourceRange s)
getNullRange _ = clang_getNullRange >>= peek
clang_getRange :: (SourceLocation a) -> (SourceLocation b) -> IO ((Ptr (SourceRange s)))
clang_getRange a1 a2 =
withVoided a1 $ \a1' ->
withVoided a2 $ \a2' ->
clang_getRange'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
getRange :: Proxy s -> SourceLocation s' -> SourceLocation s'' -> IO (SourceRange s)
getRange _ sl1 sl2 = clang_getRange sl1 sl2 >>= peek
clang_equalRanges :: (SourceRange a) -> (SourceRange b) -> IO ((Bool))
clang_equalRanges a1 a2 =
withVoided a1 $ \a1' ->
withVoided a2 $ \a2' ->
clang_equalRanges'_ a1' a2' >>= \res ->
let {res' = toBool res} in
return (res')
equalRanges :: SourceRange s' -> SourceRange s'' -> IO Bool
equalRanges sr1 sr2 = clang_equalRanges sr1 sr2
clang_Range_isNull :: (SourceRange a ) -> IO ((Bool))
clang_Range_isNull a1 =
withVoided a1 $ \a1' ->
clang_Range_isNull'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
range_isNull :: SourceRange s -> IO Bool
range_isNull s = clang_Range_isNull s
clang_getExpansionLocation :: (SourceLocation a) -> (Ptr (Ptr ())) -> (Ptr CUInt) -> (Ptr CUInt) -> (Ptr CUInt) -> IO ()
clang_getExpansionLocation a1 a2 a3 a4 a5 =
withVoided a1 $ \a1' ->
let {a2' = id a2} in
let {a3' = id a3} in
let {a4' = id a4} in
let {a5' = id a5} in
clang_getExpansionLocation'_ a1' a2' a3' a4' a5' >>
return ()
getExpansionLocation :: Proxy s -> SourceLocation s' -> IO (Maybe (File s), Int, Int, Int)
getExpansionLocation _ s =
allocaBytes 8 (\ptrToFilePtr ->
alloca (\(linePtr :: (Ptr CUInt)) ->
alloca (\(columnPtr :: (Ptr CUInt)) ->
alloca (\(offsetPtr :: (Ptr CUInt)) -> do
clang_getExpansionLocation s (castPtr ptrToFilePtr) (castPtr linePtr) (castPtr columnPtr) (castPtr offsetPtr)
filePtr <- (\ptr -> do {C2HSImp.peekByteOff ptr 0 :: IO (C2HSImp.Ptr ())}) ptrToFilePtr
let _maybeFile = maybeFile (File filePtr)
line <- peek linePtr
column <- peek columnPtr
offset <- peek offsetPtr
return (_maybeFile, fromIntegral line, fromIntegral column, fromIntegral offset)))))
clang_getPresumedLocation :: (SourceLocation a) -> (Ptr ()) -> IO ((CUInt), (CUInt))
clang_getPresumedLocation a1 a2 =
withVoided a1 $ \a1' ->
let {a2' = id a2} in
alloca $ \a3' ->
alloca $ \a4' ->
clang_getPresumedLocation'_ a1' a2' a3' a4' >>
peek a3'>>= \a3'' ->
peek a4'>>= \a4'' ->
return (a3'', a4'')
unsafe_getPresumedLocation :: SourceLocation s' -> IO (ClangString (), Int, Int)
unsafe_getPresumedLocation s =
alloca (\(stringPtr :: (Ptr (ClangString ()))) -> do
(line, column) <- clang_getPresumedLocation s (castPtr stringPtr)
clangString <- peek stringPtr
return (clangString, fromIntegral line, fromIntegral column))
getPresumedLocation :: ClangBase m => SourceLocation s' -> ClangT s m (ClangString s, Int, Int)
getPresumedLocation l = do
(f, ln, c) <- liftIO $ unsafe_getPresumedLocation l
(,,) <$> registerClangString (return f) <*> return ln <*> return c
clang_getSpellingLocation :: (SourceLocation a) -> (Ptr (Ptr ())) -> (Ptr CUInt) -> (Ptr CUInt) -> (Ptr CUInt) -> IO ()
clang_getSpellingLocation a1 a2 a3 a4 a5 =
withVoided a1 $ \a1' ->
let {a2' = id a2} in
let {a3' = id a3} in
let {a4' = id a4} in
let {a5' = id a5} in
clang_getSpellingLocation'_ a1' a2' a3' a4' a5' >>
return ()
getSpellingLocation :: Proxy s -> SourceLocation s' -> IO (Maybe (File s), Int, Int, Int)
getSpellingLocation _ s =
allocaBytes 8 (\ptrToFilePtr ->
alloca (\(linePtr :: (Ptr CUInt)) ->
alloca (\(columnPtr :: (Ptr CUInt)) ->
alloca (\(offsetPtr :: (Ptr CUInt)) -> do
clang_getSpellingLocation s (castPtr ptrToFilePtr) linePtr columnPtr offsetPtr
filePtr <- (\ptr -> do {C2HSImp.peekByteOff ptr 0 :: IO (C2HSImp.Ptr ())}) ptrToFilePtr
let _maybeFile = maybeFile (File filePtr)
line <- peek linePtr
column <- peek columnPtr
offset <- peek offsetPtr
return (_maybeFile, fromIntegral line, fromIntegral column, fromIntegral offset)))))
clang_getFileLocation :: (SourceLocation a) -> (Ptr (Ptr ())) -> (Ptr CUInt) -> (Ptr CUInt) -> (Ptr CUInt) -> IO ()
clang_getFileLocation a1 a2 a3 a4 a5 =
withVoided a1 $ \a1' ->
let {a2' = id a2} in
let {a3' = id a3} in
let {a4' = id a4} in
let {a5' = id a5} in
clang_getFileLocation'_ a1' a2' a3' a4' a5' >>
return ()
getFileLocation :: Proxy s -> SourceLocation s' -> IO (Maybe (File s), Int, Int, Int)
getFileLocation _ s =
allocaBytes 8 (\ptrToFilePtr ->
alloca (\(linePtr :: (Ptr CUInt)) ->
alloca (\(columnPtr :: (Ptr CUInt)) ->
alloca (\(offsetPtr :: (Ptr CUInt)) -> do
clang_getFileLocation s ptrToFilePtr (castPtr linePtr) (castPtr columnPtr) (castPtr offsetPtr)
filePtr <- (\ptr -> do {C2HSImp.peekByteOff ptr 0 :: IO (C2HSImp.Ptr ())}) ptrToFilePtr
let _maybeFile = maybeFile (File filePtr)
line <- peek linePtr
column <- peek columnPtr
offset <- peek offsetPtr
return (_maybeFile, fromIntegral line, fromIntegral column, fromIntegral offset)))))
clang_getRangeStart :: (SourceRange a) -> IO ((Ptr (SourceLocation s)))
clang_getRangeStart a1 =
withVoided a1 $ \a1' ->
clang_getRangeStart'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getRangeStart :: Proxy s -> SourceRange s' -> IO (SourceLocation s)
getRangeStart _ sr = clang_getRangeStart sr >>= peek
clang_getRangeEnd :: (SourceRange a) -> IO ((Ptr (SourceLocation s)))
clang_getRangeEnd a1 =
withVoided a1 $ \a1' ->
clang_getRangeEnd'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getRangeEnd :: Proxy s -> SourceRange s' -> IO (SourceLocation s)
getRangeEnd _ sr = clang_getRangeEnd sr >>= peek
data Severity = SeverityIgnored
| SeverityNote
| SeverityWarning
| SeverityError
| SeverityFatal
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum Severity where
succ SeverityIgnored = SeverityNote
succ SeverityNote = SeverityWarning
succ SeverityWarning = SeverityError
succ SeverityError = SeverityFatal
succ SeverityFatal = error "Severity.succ: SeverityFatal has no successor"
pred SeverityNote = SeverityIgnored
pred SeverityWarning = SeverityNote
pred SeverityError = SeverityWarning
pred SeverityFatal = SeverityError
pred SeverityIgnored = error "Severity.pred: SeverityIgnored has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from SeverityFatal
fromEnum SeverityIgnored = 0
fromEnum SeverityNote = 1
fromEnum SeverityWarning = 2
fromEnum SeverityError = 3
fromEnum SeverityFatal = 4
toEnum 0 = SeverityIgnored
toEnum 1 = SeverityNote
toEnum 2 = SeverityWarning
toEnum 3 = SeverityError
toEnum 4 = SeverityFatal
toEnum unmatched = error ("Severity.toEnum: Cannot match " ++ show unmatched)
newtype Diagnostic s = Diagnostic { unDiagnostic :: Ptr () }
deriving (Eq, Ord, Typeable)
instance ClangValue Diagnostic
mkDiagnostic :: Ptr () -> Diagnostic ()
mkDiagnostic = Diagnostic
clang_disposeDiagnostic :: (Ptr ()) -> IO ()
clang_disposeDiagnostic a1 =
let {a1' = id a1} in
clang_disposeDiagnostic'_ a1' >>
return ()
disposeDiagnostic:: Diagnostic s -> IO ()
disposeDiagnostic d = clang_disposeDiagnostic (unDiagnostic d)
registerDiagnostic :: ClangBase m => IO (Diagnostic ()) -> ClangT s m (Diagnostic s)
registerDiagnostic action = do
(_, idx) <- clangAllocate (action >>= return . unsafeCoerce)
(\i -> disposeDiagnostic i)
return idx
newtype DiagnosticSet s = DiagnosticSet { unDiagnosticSet :: Ptr () }
deriving (Eq, Ord, Typeable)
instance ClangValue DiagnosticSet
mkDiagnosticSet :: Ptr () -> DiagnosticSet ()
mkDiagnosticSet = DiagnosticSet
clang_disposeDiagnosticSet :: (Ptr ()) -> IO ()
clang_disposeDiagnosticSet a1 =
let {a1' = id a1} in
clang_disposeDiagnosticSet'_ a1' >>
return ()
disposeDiagnosticSet :: DiagnosticSet s -> IO ()
disposeDiagnosticSet s = clang_disposeDiagnosticSet (unDiagnosticSet s)
registerDiagnosticSet :: ClangBase m => IO (DiagnosticSet ()) -> ClangT s m (DiagnosticSet s)
registerDiagnosticSet action = do
(_, idx) <- clangAllocate (action >>= return . unsafeCoerce)
(\i -> disposeDiagnosticSet i)
return idx
clang_getNumDiagnosticsInSet :: (Ptr ()) -> IO ((Int))
clang_getNumDiagnosticsInSet a1 =
let {a1' = id a1} in
clang_getNumDiagnosticsInSet'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getNumDiagnosticsInSet :: DiagnosticSet s -> IO Int
getNumDiagnosticsInSet s = clang_getNumDiagnosticsInSet (unDiagnosticSet s)
clang_getDiagnosticInSet :: (Ptr ()) -> (Int) -> IO ((Ptr ()))
clang_getDiagnosticInSet a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
clang_getDiagnosticInSet'_ a1' a2' >>= \res ->
let {res' = id res} in
return (res')
unsafe_getDiagnosticInSet :: DiagnosticSet s -> Int -> IO (Diagnostic ())
unsafe_getDiagnosticInSet s i = clang_getDiagnosticInSet (unDiagnosticSet s) i >>= return . mkDiagnostic
getDiagnosticInSet :: ClangBase m => DiagnosticSet s' -> Int -> ClangT s m (Diagnostic s)
getDiagnosticInSet = (registerDiagnostic .) . unsafe_getDiagnosticInSet
data LoadError = LoadSuccessful
| LoadUnknownError
| LoadCannotOpen
| LoadInvalidFile
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum LoadError where
succ LoadSuccessful = LoadUnknownError
succ LoadUnknownError = LoadCannotOpen
succ LoadCannotOpen = LoadInvalidFile
succ LoadInvalidFile = error "LoadError.succ: LoadInvalidFile has no successor"
pred LoadUnknownError = LoadSuccessful
pred LoadCannotOpen = LoadUnknownError
pred LoadInvalidFile = LoadCannotOpen
pred LoadSuccessful = error "LoadError.pred: LoadSuccessful has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from LoadInvalidFile
fromEnum LoadSuccessful = 0
fromEnum LoadUnknownError = 1
fromEnum LoadCannotOpen = 2
fromEnum LoadInvalidFile = 3
toEnum 0 = LoadSuccessful
toEnum 1 = LoadUnknownError
toEnum 2 = LoadCannotOpen
toEnum 3 = LoadInvalidFile
toEnum unmatched = error ("LoadError.toEnum: Cannot match " ++ show unmatched)
data LoadDiagsResult =
LoadDiagsResult LoadError (ClangString ()) (DiagnosticSet ())
clang_loadDiagnostics :: (CString) -> (Ptr ()) -> IO ((Ptr ()), (CInt))
clang_loadDiagnostics a1 a3 =
(flip ($)) a1 $ \a1' ->
alloca $ \a2' ->
let {a3' = id a3} in
clang_loadDiagnostics'_ a1' a2' a3' >>= \res ->
let {res' = id res} in
peek a2'>>= \a2'' ->
return (res', a2'')
unsafe_loadDiagnostics :: FilePath -> IO LoadDiagsResult
unsafe_loadDiagnostics file = withCString file (\cString -> alloca (go cString))
where
go :: CString -> Ptr (ClangString ()) -> IO LoadDiagsResult
go str ptr = do
(diagnosticSetPtr, err) <- clang_loadDiagnostics str (castPtr ptr)
errString <- peek (castPtr ptr)
return (LoadDiagsResult (toEnum (fromIntegral err)) errString (DiagnosticSet diagnosticSetPtr))
loadDiagnostics :: ClangBase m => FilePath
-> ClangT s m (Either (LoadError, ClangString s) (DiagnosticSet s))
loadDiagnostics path = do
result <- liftIO $ unsafe_loadDiagnostics path
case result of
(LoadDiagsResult err errStr ds@(DiagnosticSet p))
| p == nullPtr -> Left . (err,) <$> registerClangString (return errStr)
| otherwise -> Right <$> registerDiagnosticSet (return ds)
clang_getChildDiagnostics :: (Ptr ()) -> IO ((Ptr ()))
clang_getChildDiagnostics a1 =
let {a1' = id a1} in
clang_getChildDiagnostics'_ a1' >>= \res ->
let {res' = id res} in
return (res')
unsafe_getChildDiagnostics :: Diagnostic s' -> IO (DiagnosticSet ())
unsafe_getChildDiagnostics d = clang_getChildDiagnostics (unDiagnostic d) >>= return . mkDiagnosticSet
getChildDiagnostics :: ClangBase m => Diagnostic s' -> ClangT s m (DiagnosticSet s)
getChildDiagnostics = unsafeCoerce <$> unsafe_getChildDiagnostics
clang_getNumDiagnostics :: (Ptr ()) -> IO ((CUInt))
clang_getNumDiagnostics a1 =
let {a1' = id a1} in
clang_getNumDiagnostics'_ a1' >>= \res ->
let {res' = id res} in
return (res')
getNumDiagnostics :: TranslationUnit s -> IO Int
getNumDiagnostics t = clang_getNumDiagnostics (unTranslationUnit t) >>= return . fromIntegral
clang_getDiagnostic :: (Ptr ()) -> (CUInt) -> IO ((Ptr ()))
clang_getDiagnostic a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
clang_getDiagnostic'_ a1' a2' >>= \res ->
let {res' = id res} in
return (res')
unsafe_getDiagnostic :: TranslationUnit s -> Int -> IO (Diagnostic ())
unsafe_getDiagnostic t i = clang_getDiagnostic (unTranslationUnit t) (fromIntegral i) >>= return . mkDiagnostic
getDiagnostic :: ClangBase m => TranslationUnit s' -> Int -> ClangT s m (Diagnostic s)
getDiagnostic = (registerDiagnostic .) . unsafe_getDiagnostic
clang_getDiagnosticSetFromTU :: (Ptr ()) -> IO ((Ptr ()))
clang_getDiagnosticSetFromTU a1 =
let {a1' = id a1} in
clang_getDiagnosticSetFromTU'_ a1' >>= \res ->
let {res' = id res} in
return (res')
unsafe_getDiagnosticSetFromTU :: TranslationUnit s -> IO (DiagnosticSet ())
unsafe_getDiagnosticSetFromTU t = do
set <- clang_getDiagnosticSetFromTU (unTranslationUnit t)
return (mkDiagnosticSet set)
getDiagnosticSetFromTU :: ClangBase m => TranslationUnit s' -> ClangT s m (DiagnosticSet s)
getDiagnosticSetFromTU = registerDiagnosticSet . unsafe_getDiagnosticSetFromTU
data DisplayOptions = DisplaySourceLocation
| DisplayColumn
| DisplaySourceRanges
| DisplayOption
| DisplayCategoryId
| DisplayCategoryName
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum DisplayOptions where
succ DisplaySourceLocation = DisplayColumn
succ DisplayColumn = DisplaySourceRanges
succ DisplaySourceRanges = DisplayOption
succ DisplayOption = DisplayCategoryId
succ DisplayCategoryId = DisplayCategoryName
succ DisplayCategoryName = error "DisplayOptions.succ: DisplayCategoryName has no successor"
pred DisplayColumn = DisplaySourceLocation
pred DisplaySourceRanges = DisplayColumn
pred DisplayOption = DisplaySourceRanges
pred DisplayCategoryId = DisplayOption
pred DisplayCategoryName = DisplayCategoryId
pred DisplaySourceLocation = error "DisplayOptions.pred: DisplaySourceLocation has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from DisplayCategoryName
fromEnum DisplaySourceLocation = 1
fromEnum DisplayColumn = 2
fromEnum DisplaySourceRanges = 4
fromEnum DisplayOption = 8
fromEnum DisplayCategoryId = 16
fromEnum DisplayCategoryName = 32
toEnum 1 = DisplaySourceLocation
toEnum 2 = DisplayColumn
toEnum 4 = DisplaySourceRanges
toEnum 8 = DisplayOption
toEnum 16 = DisplayCategoryId
toEnum 32 = DisplayCategoryName
toEnum unmatched = error ("DisplayOptions.toEnum: Cannot match " ++ show unmatched)
instance BitFlags DisplayOptions where
toBit DisplaySourceLocation = 0x1
toBit DisplayColumn = 0x2
toBit DisplaySourceRanges = 0x4
toBit DisplayOption = 0x8
toBit DisplayCategoryId = 0x10
toBit DisplayCategoryName = 0x20
clang_formatDiagnostic :: (Ptr ()) -> (Int) -> IO ((Ptr (ClangString ())))
clang_formatDiagnostic a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
clang_formatDiagnostic'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_formatDiagnostic :: Diagnostic s -> Int -> IO (ClangString ())
unsafe_formatDiagnostic d i = clang_formatDiagnostic (unDiagnostic d) (fromIntegral i) >>= peek
formatDiagnostic :: ClangBase m => Diagnostic s' -> Int -> ClangT s m (ClangString s)
formatDiagnostic = (registerClangString .) . unsafe_formatDiagnostic
clang_defaultDiagnosticDisplayOptions :: IO ((CUInt))
clang_defaultDiagnosticDisplayOptions =
clang_defaultDiagnosticDisplayOptions'_ >>= \res ->
let {res' = fromIntegral res} in
return (res')
defaultDiagnosticDisplayOptions :: IO Int
defaultDiagnosticDisplayOptions = clang_defaultDiagnosticDisplayOptions >>= return . fromIntegral
clang_getDiagnosticSeverity :: (Ptr ()) -> IO ((CInt))
clang_getDiagnosticSeverity a1 =
let {a1' = id a1} in
clang_getDiagnosticSeverity'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getDiagnosticSeverity :: Diagnostic s -> IO Severity
getDiagnosticSeverity d = clang_getDiagnosticSeverity (unDiagnostic d) >>= return . toEnum . fromIntegral
clang_getDiagnosticLocation :: (Ptr ()) -> IO ((Ptr (SourceLocation s)))
clang_getDiagnosticLocation a1 =
let {a1' = id a1} in
clang_getDiagnosticLocation'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getDiagnosticLocation :: Proxy s -> Diagnostic s' -> IO (SourceLocation s)
getDiagnosticLocation _ d = clang_getDiagnosticLocation (unDiagnostic d) >>= peek
clang_getDiagnosticSpelling :: (Ptr ()) -> IO ((Ptr (ClangString ())))
clang_getDiagnosticSpelling a1 =
let {a1' = id a1} in
clang_getDiagnosticSpelling'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getDiagnosticSpelling :: Diagnostic s -> IO (ClangString ())
unsafe_getDiagnosticSpelling d = clang_getDiagnosticSpelling (unDiagnostic d) >>= peek
getDiagnosticSpelling :: ClangBase m => Diagnostic s' -> ClangT s m (ClangString s)
getDiagnosticSpelling = registerClangString . unsafe_getDiagnosticSpelling
clang_getDiagnosticOption :: (Ptr ()) -> (Ptr ()) -> IO ((Ptr ()))
clang_getDiagnosticOption a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
clang_getDiagnosticOption'_ a1' a2' >>= \res ->
let {res' = id res} in
return (res')
unsafe_getDiagnosticOption :: Diagnostic s -> IO (ClangString (), ClangString ())
unsafe_getDiagnosticOption d =
alloca (\(disableCXStringPtr :: (Ptr (ClangString ()))) -> do
diagnosticOptionPtr <- clang_getDiagnosticOption (unDiagnostic d) (castPtr disableCXStringPtr)
disableCXString <- peek disableCXStringPtr
diagnosticOption <- peek (castPtr diagnosticOptionPtr)
return (diagnosticOption, disableCXString))
getDiagnosticOption :: ClangBase m => Diagnostic s' -> ClangT s m (ClangString s, ClangString s)
getDiagnosticOption d = do
(a, b) <- liftIO $ unsafe_getDiagnosticOption d
(,) <$> registerClangString (return a) <*> registerClangString (return b)
clang_getDiagnosticCategory :: (Ptr ()) -> IO ((Int))
clang_getDiagnosticCategory a1 =
let {a1' = id a1} in
clang_getDiagnosticCategory'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getDiagnosticCategory :: Diagnostic s -> IO Int
getDiagnosticCategory d = clang_getDiagnosticCategory (unDiagnostic d)
clang_getDiagnosticCategoryText :: (Ptr ()) -> IO ((Ptr (ClangString ())))
clang_getDiagnosticCategoryText a1 =
let {a1' = id a1} in
clang_getDiagnosticCategoryText'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getDiagnosticCategoryText :: Diagnostic s -> IO (ClangString ())
unsafe_getDiagnosticCategoryText d = clang_getDiagnosticCategoryText (unDiagnostic d) >>= peek
getDiagnosticCategoryText :: ClangBase m => Diagnostic s' -> ClangT s m (ClangString s)
getDiagnosticCategoryText = registerClangString . unsafe_getDiagnosticCategoryText
clang_getDiagnosticNumRanges :: (Ptr ()) -> IO ((Int))
clang_getDiagnosticNumRanges a1 =
let {a1' = id a1} in
clang_getDiagnosticNumRanges'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getDiagnosticNumRanges :: Diagnostic s -> IO Int
getDiagnosticNumRanges d = clang_getDiagnosticNumRanges (unDiagnostic d)
clang_getDiagnosticRange :: (Ptr ()) -> (Int) -> IO ((Ptr (SourceRange s)))
clang_getDiagnosticRange a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
clang_getDiagnosticRange'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
getDiagnosticRange :: Diagnostic s' -> Int -> IO (SourceRange s)
getDiagnosticRange d i = clang_getDiagnosticRange (unDiagnostic d) i >>= peek
clang_getDiagnosticNumFixIts :: (Ptr ()) -> IO ((Int))
clang_getDiagnosticNumFixIts a1 =
let {a1' = id a1} in
clang_getDiagnosticNumFixIts'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getDiagnosticNumFixIts :: Diagnostic s -> IO Int
getDiagnosticNumFixIts d = clang_getDiagnosticNumFixIts (unDiagnostic d)
clang_getDiagnosticFixIt :: (Ptr ()) -> (Int) -> (Ptr ()) -> IO ((Ptr (ClangString())))
clang_getDiagnosticFixIt a1 a2 a3 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
let {a3' = id a3} in
clang_getDiagnosticFixIt'_ a1' a2' a3' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getDiagnosticFixIt :: Diagnostic s' -> Int -> IO (SourceRange s, ClangString ())
unsafe_getDiagnosticFixIt d i =
alloca (\(replacementRangePtr :: (Ptr (SourceRange s))) -> do
clangStringPtr <- clang_getDiagnosticFixIt (unDiagnostic d) i (castPtr replacementRangePtr)
clangString <- peek clangStringPtr
replacementRange <- peek replacementRangePtr
return (replacementRange, clangString))
getDiagnosticFixIt :: ClangBase m => Diagnostic s' -> Int
-> ClangT s m (SourceRange s, ClangString s)
getDiagnosticFixIt d i = do
(r, s) <- liftIO $ unsafe_getDiagnosticFixIt d i
(r,) <$> registerClangString (return s)
clang_getTranslationUnitSpelling :: (Ptr ()) -> IO ((Ptr (ClangString ())))
clang_getTranslationUnitSpelling a1 =
let {a1' = id a1} in
clang_getTranslationUnitSpelling'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getTranslationUnitSpelling :: TranslationUnit s -> IO (ClangString ())
unsafe_getTranslationUnitSpelling t = clang_getTranslationUnitSpelling (unTranslationUnit t) >>= peek
getTranslationUnitSpelling :: ClangBase m => TranslationUnit s' -> ClangT s m (ClangString s)
getTranslationUnitSpelling = registerClangString . unsafe_getTranslationUnitSpelling
clang_createTranslationUnitFromSourceFile :: (Ptr ()) -> (CString) -> (Int) -> (Ptr CString) -> (Int) -> (Ptr ()) -> IO ((Ptr ()))
clang_createTranslationUnitFromSourceFile a1 a2 a3 a4 a5 a6 =
let {a1' = id a1} in
(flip ($)) a2 $ \a2' ->
let {a3' = fromIntegral a3} in
let {a4' = id a4} in
let {a5' = fromIntegral a5} in
let {a6' = id a6} in
clang_createTranslationUnitFromSourceFile'_ a1' a2' a3' a4' a5' a6' >>= \res ->
let {res' = id res} in
return (res')
unsafe_createTranslationUnitFromSourceFile :: Index s -> String -> Int -> Ptr CString -> Int -> Ptr CUnsavedFile -> IO (TranslationUnit ())
unsafe_createTranslationUnitFromSourceFile i s nas as nufs ufs =
withCString s (\sPtr -> do
rPtr <- clang_createTranslationUnitFromSourceFile (unIndex i) sPtr nas as nufs (castPtr ufs)
return (mkTranslationUnit rPtr))
createTranslationUnitFromSourceFile :: ClangBase m => Index s' -> String -> [String]
-> DV.Vector UnsavedFile -> ClangT s m (TranslationUnit s)
createTranslationUnitFromSourceFile idx sf as ufs =
registerTranslationUnit $
withStringList as $ \asPtr asLen ->
withUnsavedFiles ufs $ \ufsPtr ufsLen ->
unsafe_createTranslationUnitFromSourceFile idx sf asLen asPtr ufsLen ufsPtr
clang_createTranslationUnit :: (Ptr ()) -> (CString) -> IO ((Ptr ()))
clang_createTranslationUnit a1 a2 =
let {a1' = id a1} in
(flip ($)) a2 $ \a2' ->
clang_createTranslationUnit'_ a1' a2' >>= \res ->
let {res' = id res} in
return (res')
unsafe_createTranslationUnit :: Index s -> String -> IO (TranslationUnit ())
unsafe_createTranslationUnit i s =
withCString s (\strPtr -> do
trPtr <- clang_createTranslationUnit (unIndex i) strPtr
return (mkTranslationUnit trPtr))
createTranslationUnit :: ClangBase m => Index s' -> String -> ClangT s m (TranslationUnit s)
createTranslationUnit = (registerTranslationUnit .) . unsafe_createTranslationUnit
data TranslationUnitFlags = DefaultTranslationUnitFlags
| DetailedPreprocessingRecordFlag
| IncompleteFlag
| PrecompiledPreambleFlag
| CacheCompletionResultsFlag
| ForSerializationFlag
| ChainedPCHFlag
| SkipFunctionBodiesFlag
| IncludeBriefCommentsInCodeCompletionFlag
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum TranslationUnitFlags where
succ DefaultTranslationUnitFlags = DetailedPreprocessingRecordFlag
succ DetailedPreprocessingRecordFlag = IncompleteFlag
succ IncompleteFlag = PrecompiledPreambleFlag
succ PrecompiledPreambleFlag = CacheCompletionResultsFlag
succ CacheCompletionResultsFlag = ForSerializationFlag
succ ForSerializationFlag = ChainedPCHFlag
succ ChainedPCHFlag = SkipFunctionBodiesFlag
succ SkipFunctionBodiesFlag = IncludeBriefCommentsInCodeCompletionFlag
succ IncludeBriefCommentsInCodeCompletionFlag = error "TranslationUnitFlags.succ: IncludeBriefCommentsInCodeCompletionFlag has no successor"
pred DetailedPreprocessingRecordFlag = DefaultTranslationUnitFlags
pred IncompleteFlag = DetailedPreprocessingRecordFlag
pred PrecompiledPreambleFlag = IncompleteFlag
pred CacheCompletionResultsFlag = PrecompiledPreambleFlag
pred ForSerializationFlag = CacheCompletionResultsFlag
pred ChainedPCHFlag = ForSerializationFlag
pred SkipFunctionBodiesFlag = ChainedPCHFlag
pred IncludeBriefCommentsInCodeCompletionFlag = SkipFunctionBodiesFlag
pred DefaultTranslationUnitFlags = error "TranslationUnitFlags.pred: DefaultTranslationUnitFlags has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from IncludeBriefCommentsInCodeCompletionFlag
fromEnum DefaultTranslationUnitFlags = 0
fromEnum DetailedPreprocessingRecordFlag = 1
fromEnum IncompleteFlag = 2
fromEnum PrecompiledPreambleFlag = 4
fromEnum CacheCompletionResultsFlag = 8
fromEnum ForSerializationFlag = 16
fromEnum ChainedPCHFlag = 32
fromEnum SkipFunctionBodiesFlag = 64
fromEnum IncludeBriefCommentsInCodeCompletionFlag = 128
toEnum 0 = DefaultTranslationUnitFlags
toEnum 1 = DetailedPreprocessingRecordFlag
toEnum 2 = IncompleteFlag
toEnum 4 = PrecompiledPreambleFlag
toEnum 8 = CacheCompletionResultsFlag
toEnum 16 = ForSerializationFlag
toEnum 32 = ChainedPCHFlag
toEnum 64 = SkipFunctionBodiesFlag
toEnum 128 = IncludeBriefCommentsInCodeCompletionFlag
toEnum unmatched = error ("TranslationUnitFlags.toEnum: Cannot match " ++ show unmatched)
instance BitFlags TranslationUnitFlags where
toBit DefaultTranslationUnitFlags = 0x0
toBit DetailedPreprocessingRecordFlag = 0x01
toBit IncompleteFlag = 0x02
toBit PrecompiledPreambleFlag = 0x04
toBit CacheCompletionResultsFlag = 0x08
toBit ForSerializationFlag = 0x10
toBit ChainedPCHFlag = 0x20
toBit SkipFunctionBodiesFlag = 0x40
toBit IncludeBriefCommentsInCodeCompletionFlag = 0x80
defaultEditingTranslationUnitOptions :: IO ((Int))
defaultEditingTranslationUnitOptions =
defaultEditingTranslationUnitOptions'_ >>= \res ->
let {res' = fromIntegral res} in
return (res')
maybeTranslationUnit :: TranslationUnit s' -> Maybe (TranslationUnit s)
maybeTranslationUnit (TranslationUnit p) | p == nullPtr = Nothing
maybeTranslationUnit f = Just (unsafeCoerce f)
clang_parseTranslationUnit :: (Ptr ()) -> (CString) -> (Ptr CString) -> (Int) -> (Ptr ()) -> (Int) -> (Int) -> IO ((Ptr ()))
clang_parseTranslationUnit a1 a2 a3 a4 a5 a6 a7 =
let {a1' = id a1} in
(flip ($)) a2 $ \a2' ->
let {a3' = id a3} in
let {a4' = fromIntegral a4} in
let {a5' = id a5} in
let {a6' = fromIntegral a6} in
let {a7' = fromIntegral a7} in
clang_parseTranslationUnit'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
let {res' = id res} in
return (res')
unsafe_parseTranslationUnit :: Index s -> CString -> Ptr CString -> Int -> Ptr CUnsavedFile -> Int -> Int -> IO (Maybe (TranslationUnit ()))
unsafe_parseTranslationUnit i s as nas ufs nufs o =
clang_parseTranslationUnit (unIndex i) s as nas (castPtr ufs) nufs o >>= return . maybeTranslationUnit . mkTranslationUnit
parseTranslationUnit :: ClangBase m => Index s' -> Maybe String -> [String]
-> DV.Vector UnsavedFile -> Int -> ClangT s m (Maybe (TranslationUnit s))
parseTranslationUnit idx maySF as ufs opts = do
mayTU <- liftIO $
withMaybeCString maySF $ \cSF ->
withStringList as $ \asPtr asLen ->
withUnsavedFiles ufs $ \ufsPtr ufsLen ->
unsafe_parseTranslationUnit idx cSF asPtr asLen ufsPtr ufsLen opts
case mayTU of
Just tu -> Just <$> registerTranslationUnit (return tu)
Nothing -> return Nothing
withMaybeCString :: Maybe String -> (CString -> IO a) -> IO a
withMaybeCString (Just s) f = withCString s f
withMaybeCString Nothing f = f nullPtr
withStringList :: [String] -> (Ptr CString -> Int -> IO a) -> IO a
withStringList [] f = f nullPtr 0
withStringList strs f = do
let len = length strs
allocaArray len $ \arr -> go arr len arr strs
where
go arr len _ [] = f arr len
go arr len ptr (s : ss) = withCString s $ \cs -> do
poke ptr cs
go arr len (advancePtr ptr 1) ss
clang_setClangResourcesPath :: (Ptr ()) -> (CString) -> IO ()
clang_setClangResourcesPath a1 a2 =
let {a1' = id a1} in
(flip ($)) a2 $ \a2' ->
clang_setClangResourcesPath'_ a1' a2' >>
return ()
setClangResourcesPath :: Index s -> String -> IO ()
setClangResourcesPath i s =
withCString s (\stringPtr -> clang_setClangResourcesPath (unIndex i) stringPtr)
data SaveTranslationUnitFlags = DefaultSaveTranslationUnitFlags
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum SaveTranslationUnitFlags where
succ DefaultSaveTranslationUnitFlags = error "SaveTranslationUnitFlags.succ: DefaultSaveTranslationUnitFlags has no successor"
pred DefaultSaveTranslationUnitFlags = error "SaveTranslationUnitFlags.pred: DefaultSaveTranslationUnitFlags has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from DefaultSaveTranslationUnitFlags
fromEnum DefaultSaveTranslationUnitFlags = 0
toEnum 0 = DefaultSaveTranslationUnitFlags
toEnum unmatched = error ("SaveTranslationUnitFlags.toEnum: Cannot match " ++ show unmatched)
instance BitFlags SaveTranslationUnitFlags where
toBit DefaultSaveTranslationUnitFlags = 0x0
clang_defaultSaveOptions :: (Ptr ()) -> IO ((Int))
clang_defaultSaveOptions a1 =
let {a1' = id a1} in
clang_defaultSaveOptions'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
defaultSaveOptions :: TranslationUnit s -> IO Int
defaultSaveOptions t = clang_defaultSaveOptions (unTranslationUnit t)
clang_saveTranslationUnit :: (Ptr ()) -> (CString) -> (Int) -> IO ((Int))
clang_saveTranslationUnit a1 a2 a3 =
let {a1' = id a1} in
(flip ($)) a2 $ \a2' ->
let {a3' = fromIntegral a3} in
clang_saveTranslationUnit'_ a1' a2' a3' >>= \res ->
let {res' = fromIntegral res} in
return (res')
saveTranslationUnit :: TranslationUnit s -> String -> Int -> IO Bool
saveTranslationUnit t s i =
withCString s (\sPtr -> do
r <- clang_saveTranslationUnit (unTranslationUnit t) sPtr i
return (toBool ((if (r /= 0) then 0 else 1) :: Int)))
data ReparseFlags = DefaultReparseFlags
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum ReparseFlags where
succ DefaultReparseFlags = error "ReparseFlags.succ: DefaultReparseFlags has no successor"
pred DefaultReparseFlags = error "ReparseFlags.pred: DefaultReparseFlags has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from DefaultReparseFlags
fromEnum DefaultReparseFlags = 0
toEnum 0 = DefaultReparseFlags
toEnum unmatched = error ("ReparseFlags.toEnum: Cannot match " ++ show unmatched)
instance BitFlags ReparseFlags where
toBit DefaultReparseFlags = 0x0
clang_defaultReparseOptions :: (Ptr ()) -> IO ((CUInt))
clang_defaultReparseOptions a1 =
let {a1' = id a1} in
clang_defaultReparseOptions'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
defaultReparseOptions :: TranslationUnit s -> IO Int
defaultReparseOptions t = clang_defaultReparseOptions (unTranslationUnit t) >>= return . fromIntegral
clang_reparseTranslationUnit :: (Ptr ()) -> (Int) -> (Ptr ()) -> (Int) -> IO ((Bool))
clang_reparseTranslationUnit a1 a2 a3 a4 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
let {a3' = id a3} in
let {a4' = fromIntegral a4} in
clang_reparseTranslationUnit'_ a1' a2' a3' a4' >>= \res ->
let {res' = toBool res} in
return (res')
unsafe_reparseTranslationUnit :: TranslationUnit s -> Ptr CUnsavedFile -> Int -> Int -> IO Bool
unsafe_reparseTranslationUnit t ufs nufs i =
clang_reparseTranslationUnit (unTranslationUnit t) nufs (castPtr ufs) i
reparseTranslationUnit :: ClangBase m => TranslationUnit s' -> DV.Vector UnsavedFile -> Int
-> ClangT s m Bool
reparseTranslationUnit tu ufs opts = liftIO $
withUnsavedFiles ufs $ \ufsPtr ufsLen ->
unsafe_reparseTranslationUnit tu ufsPtr ufsLen opts
data CursorKind = UnexposedDeclCursor
| StructDeclCursor
| UnionDeclCursor
| ClassDeclCursor
| EnumDeclCursor
| FieldDeclCursor
| EnumConstantDeclCursor
| FunctionDeclCursor
| VarDeclCursor
| ParmDeclCursor
| ObjCInterfaceDeclCursor
| ObjCCategoryDeclCursor
| ObjCProtocolDeclCursor
| ObjCPropertyDeclCursor
| ObjCIvarDeclCursor
| ObjCInstanceMethodDeclCursor
| ObjCClassMethodDeclCursor
| ObjCImplementationDeclCursor
| ObjCCategoryImplDeclCursor
| TypedefDeclCursor
| CXXMethodCursor
| NamespaceCursor
| LinkageSpecCursor
| ConstructorCursor
| DestructorCursor
| ConversionFunctionCursor
| TemplateTypeParameterCursor
| NonTypeTemplateParameterCursor
| TemplateTemplateParameterCursor
| FunctionTemplateCursor
| ClassTemplateCursor
| ClassTemplatePartialSpecializationCursor
| NamespaceAliasCursor
| UsingDirectiveCursor
| UsingDeclarationCursor
| TypeAliasDeclCursor
| ObjCSynthesizeDeclCursor
| ObjCDynamicDeclCursor
| CXXAccessSpecifierCursor
| ObjCSuperClassRefCursor
| ObjCProtocolRefCursor
| ObjCClassRefCursor
| TypeRefCursor
| CXXBaseSpecifierCursor
| TemplateRefCursor
| NamespaceRefCursor
| MemberRefCursor
| LabelRefCursor
| OverloadedDeclRefCursor
| VariableRefCursor
| InvalidFileCursor
| NoDeclFoundCursor
| NotImplementedCursor
| InvalidCodeCursor
| UnexposedExprCursor
| DeclRefExprCursor
| MemberRefExprCursor
| CallExprCursor
| ObjCMessageExprCursor
| BlockExprCursor
| IntegerLiteralCursor
| FloatingLiteralCursor
| ImaginaryLiteralCursor
| StringLiteralCursor
| CharacterLiteralCursor
| ParenExprCursor
| UnaryOperatorCursor
| ArraySubscriptExprCursor
| BinaryOperatorCursor
| CompoundAssignOperatorCursor
| ConditionalOperatorCursor
| CStyleCastExprCursor
| CompoundLiteralExprCursor
| InitListExprCursor
| AddrLabelExprCursor
| StmtExprCursor
| GenericSelectionExprCursor
| GNUNullExprCursor
| CXXStaticCastExprCursor
| CXXDynamicCastExprCursor
| CXXReinterpretCastExprCursor
| CXXConstCastExprCursor
| CXXFunctionalCastExprCursor
| CXXTypeidExprCursor
| CXXBoolLiteralExprCursor
| CXXNullPtrLiteralExprCursor
| CXXThisExprCursor
| CXXThrowExprCursor
| CXXNewExprCursor
| CXXDeleteExprCursor
| UnaryExprCursor
| ObjCStringLiteralCursor
| ObjCEncodeExprCursor
| ObjCSelectorExprCursor
| ObjCProtocolExprCursor
| ObjCBridgedCastExprCursor
| PackExpansionExprCursor
| SizeOfPackExprCursor
| LambdaExprCursor
| ObjCBoolLiteralExprCursor
| ObjCSelfExprCursor
| UnexposedStmtCursor
| LabelStmtCursor
| CompoundStmtCursor
| CaseStmtCursor
| DefaultStmtCursor
| IfStmtCursor
| SwitchStmtCursor
| WhileStmtCursor
| DoStmtCursor
| ForStmtCursor
| GotoStmtCursor
| IndirectGotoStmtCursor
| ContinueStmtCursor
| BreakStmtCursor
| ReturnStmtCursor
| AsmStmtCursor
| ObjCAtTryStmtCursor
| ObjCAtCatchStmtCursor
| ObjCAtFinallyStmtCursor
| ObjCAtThrowStmtCursor
| ObjCAtSynchronizedStmtCursor
| ObjCAutoreleasePoolStmtCursor
| ObjCForCollectionStmtCursor
| CXXCatchStmtCursor
| CXXTryStmtCursor
| CXXForRangeStmtCursor
| SEHTryStmtCursor
| SEHExceptStmtCursor
| SEHFinallyStmtCursor
| MSAsmStmtCursor
| NullStmtCursor
| DeclStmtCursor
| OMPParallelDirectiveCursor
| TranslationUnitCursor
| UnexposedAttrCursor
| IBActionAttrCursor
| IBOutletAttrCursor
| IBOutletCollectionAttrCursor
| CXXFinalAttrCursor
| CXXOverrideAttrCursor
| AnnotateAttrCursor
| AsmLabelAttrCursor
| PackedAttrCursor
| PreprocessingDirectiveCursor
| MacroDefinitionCursor
| MacroExpansionCursor
| InclusionDirectiveCursor
| ModuleImportDeclCursor
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum CursorKind where
succ UnexposedDeclCursor = StructDeclCursor
succ StructDeclCursor = UnionDeclCursor
succ UnionDeclCursor = ClassDeclCursor
succ ClassDeclCursor = EnumDeclCursor
succ EnumDeclCursor = FieldDeclCursor
succ FieldDeclCursor = EnumConstantDeclCursor
succ EnumConstantDeclCursor = FunctionDeclCursor
succ FunctionDeclCursor = VarDeclCursor
succ VarDeclCursor = ParmDeclCursor
succ ParmDeclCursor = ObjCInterfaceDeclCursor
succ ObjCInterfaceDeclCursor = ObjCCategoryDeclCursor
succ ObjCCategoryDeclCursor = ObjCProtocolDeclCursor
succ ObjCProtocolDeclCursor = ObjCPropertyDeclCursor
succ ObjCPropertyDeclCursor = ObjCIvarDeclCursor
succ ObjCIvarDeclCursor = ObjCInstanceMethodDeclCursor
succ ObjCInstanceMethodDeclCursor = ObjCClassMethodDeclCursor
succ ObjCClassMethodDeclCursor = ObjCImplementationDeclCursor
succ ObjCImplementationDeclCursor = ObjCCategoryImplDeclCursor
succ ObjCCategoryImplDeclCursor = TypedefDeclCursor
succ TypedefDeclCursor = CXXMethodCursor
succ CXXMethodCursor = NamespaceCursor
succ NamespaceCursor = LinkageSpecCursor
succ LinkageSpecCursor = ConstructorCursor
succ ConstructorCursor = DestructorCursor
succ DestructorCursor = ConversionFunctionCursor
succ ConversionFunctionCursor = TemplateTypeParameterCursor
succ TemplateTypeParameterCursor = NonTypeTemplateParameterCursor
succ NonTypeTemplateParameterCursor = TemplateTemplateParameterCursor
succ TemplateTemplateParameterCursor = FunctionTemplateCursor
succ FunctionTemplateCursor = ClassTemplateCursor
succ ClassTemplateCursor = ClassTemplatePartialSpecializationCursor
succ ClassTemplatePartialSpecializationCursor = NamespaceAliasCursor
succ NamespaceAliasCursor = UsingDirectiveCursor
succ UsingDirectiveCursor = UsingDeclarationCursor
succ UsingDeclarationCursor = TypeAliasDeclCursor
succ TypeAliasDeclCursor = ObjCSynthesizeDeclCursor
succ ObjCSynthesizeDeclCursor = ObjCDynamicDeclCursor
succ ObjCDynamicDeclCursor = CXXAccessSpecifierCursor
succ CXXAccessSpecifierCursor = ObjCSuperClassRefCursor
succ ObjCSuperClassRefCursor = ObjCProtocolRefCursor
succ ObjCProtocolRefCursor = ObjCClassRefCursor
succ ObjCClassRefCursor = TypeRefCursor
succ TypeRefCursor = CXXBaseSpecifierCursor
succ CXXBaseSpecifierCursor = TemplateRefCursor
succ TemplateRefCursor = NamespaceRefCursor
succ NamespaceRefCursor = MemberRefCursor
succ MemberRefCursor = LabelRefCursor
succ LabelRefCursor = OverloadedDeclRefCursor
succ OverloadedDeclRefCursor = VariableRefCursor
succ VariableRefCursor = InvalidFileCursor
succ InvalidFileCursor = NoDeclFoundCursor
succ NoDeclFoundCursor = NotImplementedCursor
succ NotImplementedCursor = InvalidCodeCursor
succ InvalidCodeCursor = UnexposedExprCursor
succ UnexposedExprCursor = DeclRefExprCursor
succ DeclRefExprCursor = MemberRefExprCursor
succ MemberRefExprCursor = CallExprCursor
succ CallExprCursor = ObjCMessageExprCursor
succ ObjCMessageExprCursor = BlockExprCursor
succ BlockExprCursor = IntegerLiteralCursor
succ IntegerLiteralCursor = FloatingLiteralCursor
succ FloatingLiteralCursor = ImaginaryLiteralCursor
succ ImaginaryLiteralCursor = StringLiteralCursor
succ StringLiteralCursor = CharacterLiteralCursor
succ CharacterLiteralCursor = ParenExprCursor
succ ParenExprCursor = UnaryOperatorCursor
succ UnaryOperatorCursor = ArraySubscriptExprCursor
succ ArraySubscriptExprCursor = BinaryOperatorCursor
succ BinaryOperatorCursor = CompoundAssignOperatorCursor
succ CompoundAssignOperatorCursor = ConditionalOperatorCursor
succ ConditionalOperatorCursor = CStyleCastExprCursor
succ CStyleCastExprCursor = CompoundLiteralExprCursor
succ CompoundLiteralExprCursor = InitListExprCursor
succ InitListExprCursor = AddrLabelExprCursor
succ AddrLabelExprCursor = StmtExprCursor
succ StmtExprCursor = GenericSelectionExprCursor
succ GenericSelectionExprCursor = GNUNullExprCursor
succ GNUNullExprCursor = CXXStaticCastExprCursor
succ CXXStaticCastExprCursor = CXXDynamicCastExprCursor
succ CXXDynamicCastExprCursor = CXXReinterpretCastExprCursor
succ CXXReinterpretCastExprCursor = CXXConstCastExprCursor
succ CXXConstCastExprCursor = CXXFunctionalCastExprCursor
succ CXXFunctionalCastExprCursor = CXXTypeidExprCursor
succ CXXTypeidExprCursor = CXXBoolLiteralExprCursor
succ CXXBoolLiteralExprCursor = CXXNullPtrLiteralExprCursor
succ CXXNullPtrLiteralExprCursor = CXXThisExprCursor
succ CXXThisExprCursor = CXXThrowExprCursor
succ CXXThrowExprCursor = CXXNewExprCursor
succ CXXNewExprCursor = CXXDeleteExprCursor
succ CXXDeleteExprCursor = UnaryExprCursor
succ UnaryExprCursor = ObjCStringLiteralCursor
succ ObjCStringLiteralCursor = ObjCEncodeExprCursor
succ ObjCEncodeExprCursor = ObjCSelectorExprCursor
succ ObjCSelectorExprCursor = ObjCProtocolExprCursor
succ ObjCProtocolExprCursor = ObjCBridgedCastExprCursor
succ ObjCBridgedCastExprCursor = PackExpansionExprCursor
succ PackExpansionExprCursor = SizeOfPackExprCursor
succ SizeOfPackExprCursor = LambdaExprCursor
succ LambdaExprCursor = ObjCBoolLiteralExprCursor
succ ObjCBoolLiteralExprCursor = ObjCSelfExprCursor
succ ObjCSelfExprCursor = UnexposedStmtCursor
succ UnexposedStmtCursor = LabelStmtCursor
succ LabelStmtCursor = CompoundStmtCursor
succ CompoundStmtCursor = CaseStmtCursor
succ CaseStmtCursor = DefaultStmtCursor
succ DefaultStmtCursor = IfStmtCursor
succ IfStmtCursor = SwitchStmtCursor
succ SwitchStmtCursor = WhileStmtCursor
succ WhileStmtCursor = DoStmtCursor
succ DoStmtCursor = ForStmtCursor
succ ForStmtCursor = GotoStmtCursor
succ GotoStmtCursor = IndirectGotoStmtCursor
succ IndirectGotoStmtCursor = ContinueStmtCursor
succ ContinueStmtCursor = BreakStmtCursor
succ BreakStmtCursor = ReturnStmtCursor
succ ReturnStmtCursor = AsmStmtCursor
succ AsmStmtCursor = ObjCAtTryStmtCursor
succ ObjCAtTryStmtCursor = ObjCAtCatchStmtCursor
succ ObjCAtCatchStmtCursor = ObjCAtFinallyStmtCursor
succ ObjCAtFinallyStmtCursor = ObjCAtThrowStmtCursor
succ ObjCAtThrowStmtCursor = ObjCAtSynchronizedStmtCursor
succ ObjCAtSynchronizedStmtCursor = ObjCAutoreleasePoolStmtCursor
succ ObjCAutoreleasePoolStmtCursor = ObjCForCollectionStmtCursor
succ ObjCForCollectionStmtCursor = CXXCatchStmtCursor
succ CXXCatchStmtCursor = CXXTryStmtCursor
succ CXXTryStmtCursor = CXXForRangeStmtCursor
succ CXXForRangeStmtCursor = SEHTryStmtCursor
succ SEHTryStmtCursor = SEHExceptStmtCursor
succ SEHExceptStmtCursor = SEHFinallyStmtCursor
succ SEHFinallyStmtCursor = MSAsmStmtCursor
succ MSAsmStmtCursor = NullStmtCursor
succ NullStmtCursor = DeclStmtCursor
succ DeclStmtCursor = OMPParallelDirectiveCursor
succ OMPParallelDirectiveCursor = TranslationUnitCursor
succ TranslationUnitCursor = UnexposedAttrCursor
succ UnexposedAttrCursor = IBActionAttrCursor
succ IBActionAttrCursor = IBOutletAttrCursor
succ IBOutletAttrCursor = IBOutletCollectionAttrCursor
succ IBOutletCollectionAttrCursor = CXXFinalAttrCursor
succ CXXFinalAttrCursor = CXXOverrideAttrCursor
succ CXXOverrideAttrCursor = AnnotateAttrCursor
succ AnnotateAttrCursor = AsmLabelAttrCursor
succ AsmLabelAttrCursor = PackedAttrCursor
succ PackedAttrCursor = PreprocessingDirectiveCursor
succ PreprocessingDirectiveCursor = MacroDefinitionCursor
succ MacroDefinitionCursor = MacroExpansionCursor
succ MacroExpansionCursor = InclusionDirectiveCursor
succ InclusionDirectiveCursor = ModuleImportDeclCursor
succ ModuleImportDeclCursor = error "CursorKind.succ: ModuleImportDeclCursor has no successor"
pred StructDeclCursor = UnexposedDeclCursor
pred UnionDeclCursor = StructDeclCursor
pred ClassDeclCursor = UnionDeclCursor
pred EnumDeclCursor = ClassDeclCursor
pred FieldDeclCursor = EnumDeclCursor
pred EnumConstantDeclCursor = FieldDeclCursor
pred FunctionDeclCursor = EnumConstantDeclCursor
pred VarDeclCursor = FunctionDeclCursor
pred ParmDeclCursor = VarDeclCursor
pred ObjCInterfaceDeclCursor = ParmDeclCursor
pred ObjCCategoryDeclCursor = ObjCInterfaceDeclCursor
pred ObjCProtocolDeclCursor = ObjCCategoryDeclCursor
pred ObjCPropertyDeclCursor = ObjCProtocolDeclCursor
pred ObjCIvarDeclCursor = ObjCPropertyDeclCursor
pred ObjCInstanceMethodDeclCursor = ObjCIvarDeclCursor
pred ObjCClassMethodDeclCursor = ObjCInstanceMethodDeclCursor
pred ObjCImplementationDeclCursor = ObjCClassMethodDeclCursor
pred ObjCCategoryImplDeclCursor = ObjCImplementationDeclCursor
pred TypedefDeclCursor = ObjCCategoryImplDeclCursor
pred CXXMethodCursor = TypedefDeclCursor
pred NamespaceCursor = CXXMethodCursor
pred LinkageSpecCursor = NamespaceCursor
pred ConstructorCursor = LinkageSpecCursor
pred DestructorCursor = ConstructorCursor
pred ConversionFunctionCursor = DestructorCursor
pred TemplateTypeParameterCursor = ConversionFunctionCursor
pred NonTypeTemplateParameterCursor = TemplateTypeParameterCursor
pred TemplateTemplateParameterCursor = NonTypeTemplateParameterCursor
pred FunctionTemplateCursor = TemplateTemplateParameterCursor
pred ClassTemplateCursor = FunctionTemplateCursor
pred ClassTemplatePartialSpecializationCursor = ClassTemplateCursor
pred NamespaceAliasCursor = ClassTemplatePartialSpecializationCursor
pred UsingDirectiveCursor = NamespaceAliasCursor
pred UsingDeclarationCursor = UsingDirectiveCursor
pred TypeAliasDeclCursor = UsingDeclarationCursor
pred ObjCSynthesizeDeclCursor = TypeAliasDeclCursor
pred ObjCDynamicDeclCursor = ObjCSynthesizeDeclCursor
pred CXXAccessSpecifierCursor = ObjCDynamicDeclCursor
pred ObjCSuperClassRefCursor = CXXAccessSpecifierCursor
pred ObjCProtocolRefCursor = ObjCSuperClassRefCursor
pred ObjCClassRefCursor = ObjCProtocolRefCursor
pred TypeRefCursor = ObjCClassRefCursor
pred CXXBaseSpecifierCursor = TypeRefCursor
pred TemplateRefCursor = CXXBaseSpecifierCursor
pred NamespaceRefCursor = TemplateRefCursor
pred MemberRefCursor = NamespaceRefCursor
pred LabelRefCursor = MemberRefCursor
pred OverloadedDeclRefCursor = LabelRefCursor
pred VariableRefCursor = OverloadedDeclRefCursor
pred InvalidFileCursor = VariableRefCursor
pred NoDeclFoundCursor = InvalidFileCursor
pred NotImplementedCursor = NoDeclFoundCursor
pred InvalidCodeCursor = NotImplementedCursor
pred UnexposedExprCursor = InvalidCodeCursor
pred DeclRefExprCursor = UnexposedExprCursor
pred MemberRefExprCursor = DeclRefExprCursor
pred CallExprCursor = MemberRefExprCursor
pred ObjCMessageExprCursor = CallExprCursor
pred BlockExprCursor = ObjCMessageExprCursor
pred IntegerLiteralCursor = BlockExprCursor
pred FloatingLiteralCursor = IntegerLiteralCursor
pred ImaginaryLiteralCursor = FloatingLiteralCursor
pred StringLiteralCursor = ImaginaryLiteralCursor
pred CharacterLiteralCursor = StringLiteralCursor
pred ParenExprCursor = CharacterLiteralCursor
pred UnaryOperatorCursor = ParenExprCursor
pred ArraySubscriptExprCursor = UnaryOperatorCursor
pred BinaryOperatorCursor = ArraySubscriptExprCursor
pred CompoundAssignOperatorCursor = BinaryOperatorCursor
pred ConditionalOperatorCursor = CompoundAssignOperatorCursor
pred CStyleCastExprCursor = ConditionalOperatorCursor
pred CompoundLiteralExprCursor = CStyleCastExprCursor
pred InitListExprCursor = CompoundLiteralExprCursor
pred AddrLabelExprCursor = InitListExprCursor
pred StmtExprCursor = AddrLabelExprCursor
pred GenericSelectionExprCursor = StmtExprCursor
pred GNUNullExprCursor = GenericSelectionExprCursor
pred CXXStaticCastExprCursor = GNUNullExprCursor
pred CXXDynamicCastExprCursor = CXXStaticCastExprCursor
pred CXXReinterpretCastExprCursor = CXXDynamicCastExprCursor
pred CXXConstCastExprCursor = CXXReinterpretCastExprCursor
pred CXXFunctionalCastExprCursor = CXXConstCastExprCursor
pred CXXTypeidExprCursor = CXXFunctionalCastExprCursor
pred CXXBoolLiteralExprCursor = CXXTypeidExprCursor
pred CXXNullPtrLiteralExprCursor = CXXBoolLiteralExprCursor
pred CXXThisExprCursor = CXXNullPtrLiteralExprCursor
pred CXXThrowExprCursor = CXXThisExprCursor
pred CXXNewExprCursor = CXXThrowExprCursor
pred CXXDeleteExprCursor = CXXNewExprCursor
pred UnaryExprCursor = CXXDeleteExprCursor
pred ObjCStringLiteralCursor = UnaryExprCursor
pred ObjCEncodeExprCursor = ObjCStringLiteralCursor
pred ObjCSelectorExprCursor = ObjCEncodeExprCursor
pred ObjCProtocolExprCursor = ObjCSelectorExprCursor
pred ObjCBridgedCastExprCursor = ObjCProtocolExprCursor
pred PackExpansionExprCursor = ObjCBridgedCastExprCursor
pred SizeOfPackExprCursor = PackExpansionExprCursor
pred LambdaExprCursor = SizeOfPackExprCursor
pred ObjCBoolLiteralExprCursor = LambdaExprCursor
pred ObjCSelfExprCursor = ObjCBoolLiteralExprCursor
pred UnexposedStmtCursor = ObjCSelfExprCursor
pred LabelStmtCursor = UnexposedStmtCursor
pred CompoundStmtCursor = LabelStmtCursor
pred CaseStmtCursor = CompoundStmtCursor
pred DefaultStmtCursor = CaseStmtCursor
pred IfStmtCursor = DefaultStmtCursor
pred SwitchStmtCursor = IfStmtCursor
pred WhileStmtCursor = SwitchStmtCursor
pred DoStmtCursor = WhileStmtCursor
pred ForStmtCursor = DoStmtCursor
pred GotoStmtCursor = ForStmtCursor
pred IndirectGotoStmtCursor = GotoStmtCursor
pred ContinueStmtCursor = IndirectGotoStmtCursor
pred BreakStmtCursor = ContinueStmtCursor
pred ReturnStmtCursor = BreakStmtCursor
pred AsmStmtCursor = ReturnStmtCursor
pred ObjCAtTryStmtCursor = AsmStmtCursor
pred ObjCAtCatchStmtCursor = ObjCAtTryStmtCursor
pred ObjCAtFinallyStmtCursor = ObjCAtCatchStmtCursor
pred ObjCAtThrowStmtCursor = ObjCAtFinallyStmtCursor
pred ObjCAtSynchronizedStmtCursor = ObjCAtThrowStmtCursor
pred ObjCAutoreleasePoolStmtCursor = ObjCAtSynchronizedStmtCursor
pred ObjCForCollectionStmtCursor = ObjCAutoreleasePoolStmtCursor
pred CXXCatchStmtCursor = ObjCForCollectionStmtCursor
pred CXXTryStmtCursor = CXXCatchStmtCursor
pred CXXForRangeStmtCursor = CXXTryStmtCursor
pred SEHTryStmtCursor = CXXForRangeStmtCursor
pred SEHExceptStmtCursor = SEHTryStmtCursor
pred SEHFinallyStmtCursor = SEHExceptStmtCursor
pred MSAsmStmtCursor = SEHFinallyStmtCursor
pred NullStmtCursor = MSAsmStmtCursor
pred DeclStmtCursor = NullStmtCursor
pred OMPParallelDirectiveCursor = DeclStmtCursor
pred TranslationUnitCursor = OMPParallelDirectiveCursor
pred UnexposedAttrCursor = TranslationUnitCursor
pred IBActionAttrCursor = UnexposedAttrCursor
pred IBOutletAttrCursor = IBActionAttrCursor
pred IBOutletCollectionAttrCursor = IBOutletAttrCursor
pred CXXFinalAttrCursor = IBOutletCollectionAttrCursor
pred CXXOverrideAttrCursor = CXXFinalAttrCursor
pred AnnotateAttrCursor = CXXOverrideAttrCursor
pred AsmLabelAttrCursor = AnnotateAttrCursor
pred PackedAttrCursor = AsmLabelAttrCursor
pred PreprocessingDirectiveCursor = PackedAttrCursor
pred MacroDefinitionCursor = PreprocessingDirectiveCursor
pred MacroExpansionCursor = MacroDefinitionCursor
pred InclusionDirectiveCursor = MacroExpansionCursor
pred ModuleImportDeclCursor = InclusionDirectiveCursor
pred UnexposedDeclCursor = error "CursorKind.pred: UnexposedDeclCursor has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from ModuleImportDeclCursor
fromEnum UnexposedDeclCursor = 1
fromEnum StructDeclCursor = 2
fromEnum UnionDeclCursor = 3
fromEnum ClassDeclCursor = 4
fromEnum EnumDeclCursor = 5
fromEnum FieldDeclCursor = 6
fromEnum EnumConstantDeclCursor = 7
fromEnum FunctionDeclCursor = 8
fromEnum VarDeclCursor = 9
fromEnum ParmDeclCursor = 10
fromEnum ObjCInterfaceDeclCursor = 11
fromEnum ObjCCategoryDeclCursor = 12
fromEnum ObjCProtocolDeclCursor = 13
fromEnum ObjCPropertyDeclCursor = 14
fromEnum ObjCIvarDeclCursor = 15
fromEnum ObjCInstanceMethodDeclCursor = 16
fromEnum ObjCClassMethodDeclCursor = 17
fromEnum ObjCImplementationDeclCursor = 18
fromEnum ObjCCategoryImplDeclCursor = 19
fromEnum TypedefDeclCursor = 20
fromEnum CXXMethodCursor = 21
fromEnum NamespaceCursor = 22
fromEnum LinkageSpecCursor = 23
fromEnum ConstructorCursor = 24
fromEnum DestructorCursor = 25
fromEnum ConversionFunctionCursor = 26
fromEnum TemplateTypeParameterCursor = 27
fromEnum NonTypeTemplateParameterCursor = 28
fromEnum TemplateTemplateParameterCursor = 29
fromEnum FunctionTemplateCursor = 30
fromEnum ClassTemplateCursor = 31
fromEnum ClassTemplatePartialSpecializationCursor = 32
fromEnum NamespaceAliasCursor = 33
fromEnum UsingDirectiveCursor = 34
fromEnum UsingDeclarationCursor = 35
fromEnum TypeAliasDeclCursor = 36
fromEnum ObjCSynthesizeDeclCursor = 37
fromEnum ObjCDynamicDeclCursor = 38
fromEnum CXXAccessSpecifierCursor = 39
fromEnum ObjCSuperClassRefCursor = 40
fromEnum ObjCProtocolRefCursor = 41
fromEnum ObjCClassRefCursor = 42
fromEnum TypeRefCursor = 43
fromEnum CXXBaseSpecifierCursor = 44
fromEnum TemplateRefCursor = 45
fromEnum NamespaceRefCursor = 46
fromEnum MemberRefCursor = 47
fromEnum LabelRefCursor = 48
fromEnum OverloadedDeclRefCursor = 49
fromEnum VariableRefCursor = 50
fromEnum InvalidFileCursor = 70
fromEnum NoDeclFoundCursor = 71
fromEnum NotImplementedCursor = 72
fromEnum InvalidCodeCursor = 73
fromEnum UnexposedExprCursor = 100
fromEnum DeclRefExprCursor = 101
fromEnum MemberRefExprCursor = 102
fromEnum CallExprCursor = 103
fromEnum ObjCMessageExprCursor = 104
fromEnum BlockExprCursor = 105
fromEnum IntegerLiteralCursor = 106
fromEnum FloatingLiteralCursor = 107
fromEnum ImaginaryLiteralCursor = 108
fromEnum StringLiteralCursor = 109
fromEnum CharacterLiteralCursor = 110
fromEnum ParenExprCursor = 111
fromEnum UnaryOperatorCursor = 112
fromEnum ArraySubscriptExprCursor = 113
fromEnum BinaryOperatorCursor = 114
fromEnum CompoundAssignOperatorCursor = 115
fromEnum ConditionalOperatorCursor = 116
fromEnum CStyleCastExprCursor = 117
fromEnum CompoundLiteralExprCursor = 118
fromEnum InitListExprCursor = 119
fromEnum AddrLabelExprCursor = 120
fromEnum StmtExprCursor = 121
fromEnum GenericSelectionExprCursor = 122
fromEnum GNUNullExprCursor = 123
fromEnum CXXStaticCastExprCursor = 124
fromEnum CXXDynamicCastExprCursor = 125
fromEnum CXXReinterpretCastExprCursor = 126
fromEnum CXXConstCastExprCursor = 127
fromEnum CXXFunctionalCastExprCursor = 128
fromEnum CXXTypeidExprCursor = 129
fromEnum CXXBoolLiteralExprCursor = 130
fromEnum CXXNullPtrLiteralExprCursor = 131
fromEnum CXXThisExprCursor = 132
fromEnum CXXThrowExprCursor = 133
fromEnum CXXNewExprCursor = 134
fromEnum CXXDeleteExprCursor = 135
fromEnum UnaryExprCursor = 136
fromEnum ObjCStringLiteralCursor = 137
fromEnum ObjCEncodeExprCursor = 138
fromEnum ObjCSelectorExprCursor = 139
fromEnum ObjCProtocolExprCursor = 140
fromEnum ObjCBridgedCastExprCursor = 141
fromEnum PackExpansionExprCursor = 142
fromEnum SizeOfPackExprCursor = 143
fromEnum LambdaExprCursor = 144
fromEnum ObjCBoolLiteralExprCursor = 145
fromEnum ObjCSelfExprCursor = 146
fromEnum UnexposedStmtCursor = 200
fromEnum LabelStmtCursor = 201
fromEnum CompoundStmtCursor = 202
fromEnum CaseStmtCursor = 203
fromEnum DefaultStmtCursor = 204
fromEnum IfStmtCursor = 205
fromEnum SwitchStmtCursor = 206
fromEnum WhileStmtCursor = 207
fromEnum DoStmtCursor = 208
fromEnum ForStmtCursor = 209
fromEnum GotoStmtCursor = 210
fromEnum IndirectGotoStmtCursor = 211
fromEnum ContinueStmtCursor = 212
fromEnum BreakStmtCursor = 213
fromEnum ReturnStmtCursor = 214
fromEnum AsmStmtCursor = 215
fromEnum ObjCAtTryStmtCursor = 216
fromEnum ObjCAtCatchStmtCursor = 217
fromEnum ObjCAtFinallyStmtCursor = 218
fromEnum ObjCAtThrowStmtCursor = 219
fromEnum ObjCAtSynchronizedStmtCursor = 220
fromEnum ObjCAutoreleasePoolStmtCursor = 221
fromEnum ObjCForCollectionStmtCursor = 222
fromEnum CXXCatchStmtCursor = 223
fromEnum CXXTryStmtCursor = 224
fromEnum CXXForRangeStmtCursor = 225
fromEnum SEHTryStmtCursor = 226
fromEnum SEHExceptStmtCursor = 227
fromEnum SEHFinallyStmtCursor = 228
fromEnum MSAsmStmtCursor = 229
fromEnum NullStmtCursor = 230
fromEnum DeclStmtCursor = 231
fromEnum OMPParallelDirectiveCursor = 232
fromEnum TranslationUnitCursor = 300
fromEnum UnexposedAttrCursor = 400
fromEnum IBActionAttrCursor = 401
fromEnum IBOutletAttrCursor = 402
fromEnum IBOutletCollectionAttrCursor = 403
fromEnum CXXFinalAttrCursor = 404
fromEnum CXXOverrideAttrCursor = 405
fromEnum AnnotateAttrCursor = 406
fromEnum AsmLabelAttrCursor = 407
fromEnum PackedAttrCursor = 408
fromEnum PreprocessingDirectiveCursor = 500
fromEnum MacroDefinitionCursor = 501
fromEnum MacroExpansionCursor = 502
fromEnum InclusionDirectiveCursor = 503
fromEnum ModuleImportDeclCursor = 600
toEnum 1 = UnexposedDeclCursor
toEnum 2 = StructDeclCursor
toEnum 3 = UnionDeclCursor
toEnum 4 = ClassDeclCursor
toEnum 5 = EnumDeclCursor
toEnum 6 = FieldDeclCursor
toEnum 7 = EnumConstantDeclCursor
toEnum 8 = FunctionDeclCursor
toEnum 9 = VarDeclCursor
toEnum 10 = ParmDeclCursor
toEnum 11 = ObjCInterfaceDeclCursor
toEnum 12 = ObjCCategoryDeclCursor
toEnum 13 = ObjCProtocolDeclCursor
toEnum 14 = ObjCPropertyDeclCursor
toEnum 15 = ObjCIvarDeclCursor
toEnum 16 = ObjCInstanceMethodDeclCursor
toEnum 17 = ObjCClassMethodDeclCursor
toEnum 18 = ObjCImplementationDeclCursor
toEnum 19 = ObjCCategoryImplDeclCursor
toEnum 20 = TypedefDeclCursor
toEnum 21 = CXXMethodCursor
toEnum 22 = NamespaceCursor
toEnum 23 = LinkageSpecCursor
toEnum 24 = ConstructorCursor
toEnum 25 = DestructorCursor
toEnum 26 = ConversionFunctionCursor
toEnum 27 = TemplateTypeParameterCursor
toEnum 28 = NonTypeTemplateParameterCursor
toEnum 29 = TemplateTemplateParameterCursor
toEnum 30 = FunctionTemplateCursor
toEnum 31 = ClassTemplateCursor
toEnum 32 = ClassTemplatePartialSpecializationCursor
toEnum 33 = NamespaceAliasCursor
toEnum 34 = UsingDirectiveCursor
toEnum 35 = UsingDeclarationCursor
toEnum 36 = TypeAliasDeclCursor
toEnum 37 = ObjCSynthesizeDeclCursor
toEnum 38 = ObjCDynamicDeclCursor
toEnum 39 = CXXAccessSpecifierCursor
toEnum 40 = ObjCSuperClassRefCursor
toEnum 41 = ObjCProtocolRefCursor
toEnum 42 = ObjCClassRefCursor
toEnum 43 = TypeRefCursor
toEnum 44 = CXXBaseSpecifierCursor
toEnum 45 = TemplateRefCursor
toEnum 46 = NamespaceRefCursor
toEnum 47 = MemberRefCursor
toEnum 48 = LabelRefCursor
toEnum 49 = OverloadedDeclRefCursor
toEnum 50 = VariableRefCursor
toEnum 70 = InvalidFileCursor
toEnum 71 = NoDeclFoundCursor
toEnum 72 = NotImplementedCursor
toEnum 73 = InvalidCodeCursor
toEnum 100 = UnexposedExprCursor
toEnum 101 = DeclRefExprCursor
toEnum 102 = MemberRefExprCursor
toEnum 103 = CallExprCursor
toEnum 104 = ObjCMessageExprCursor
toEnum 105 = BlockExprCursor
toEnum 106 = IntegerLiteralCursor
toEnum 107 = FloatingLiteralCursor
toEnum 108 = ImaginaryLiteralCursor
toEnum 109 = StringLiteralCursor
toEnum 110 = CharacterLiteralCursor
toEnum 111 = ParenExprCursor
toEnum 112 = UnaryOperatorCursor
toEnum 113 = ArraySubscriptExprCursor
toEnum 114 = BinaryOperatorCursor
toEnum 115 = CompoundAssignOperatorCursor
toEnum 116 = ConditionalOperatorCursor
toEnum 117 = CStyleCastExprCursor
toEnum 118 = CompoundLiteralExprCursor
toEnum 119 = InitListExprCursor
toEnum 120 = AddrLabelExprCursor
toEnum 121 = StmtExprCursor
toEnum 122 = GenericSelectionExprCursor
toEnum 123 = GNUNullExprCursor
toEnum 124 = CXXStaticCastExprCursor
toEnum 125 = CXXDynamicCastExprCursor
toEnum 126 = CXXReinterpretCastExprCursor
toEnum 127 = CXXConstCastExprCursor
toEnum 128 = CXXFunctionalCastExprCursor
toEnum 129 = CXXTypeidExprCursor
toEnum 130 = CXXBoolLiteralExprCursor
toEnum 131 = CXXNullPtrLiteralExprCursor
toEnum 132 = CXXThisExprCursor
toEnum 133 = CXXThrowExprCursor
toEnum 134 = CXXNewExprCursor
toEnum 135 = CXXDeleteExprCursor
toEnum 136 = UnaryExprCursor
toEnum 137 = ObjCStringLiteralCursor
toEnum 138 = ObjCEncodeExprCursor
toEnum 139 = ObjCSelectorExprCursor
toEnum 140 = ObjCProtocolExprCursor
toEnum 141 = ObjCBridgedCastExprCursor
toEnum 142 = PackExpansionExprCursor
toEnum 143 = SizeOfPackExprCursor
toEnum 144 = LambdaExprCursor
toEnum 145 = ObjCBoolLiteralExprCursor
toEnum 146 = ObjCSelfExprCursor
toEnum 200 = UnexposedStmtCursor
toEnum 201 = LabelStmtCursor
toEnum 202 = CompoundStmtCursor
toEnum 203 = CaseStmtCursor
toEnum 204 = DefaultStmtCursor
toEnum 205 = IfStmtCursor
toEnum 206 = SwitchStmtCursor
toEnum 207 = WhileStmtCursor
toEnum 208 = DoStmtCursor
toEnum 209 = ForStmtCursor
toEnum 210 = GotoStmtCursor
toEnum 211 = IndirectGotoStmtCursor
toEnum 212 = ContinueStmtCursor
toEnum 213 = BreakStmtCursor
toEnum 214 = ReturnStmtCursor
toEnum 215 = AsmStmtCursor
toEnum 216 = ObjCAtTryStmtCursor
toEnum 217 = ObjCAtCatchStmtCursor
toEnum 218 = ObjCAtFinallyStmtCursor
toEnum 219 = ObjCAtThrowStmtCursor
toEnum 220 = ObjCAtSynchronizedStmtCursor
toEnum 221 = ObjCAutoreleasePoolStmtCursor
toEnum 222 = ObjCForCollectionStmtCursor
toEnum 223 = CXXCatchStmtCursor
toEnum 224 = CXXTryStmtCursor
toEnum 225 = CXXForRangeStmtCursor
toEnum 226 = SEHTryStmtCursor
toEnum 227 = SEHExceptStmtCursor
toEnum 228 = SEHFinallyStmtCursor
toEnum 229 = MSAsmStmtCursor
toEnum 230 = NullStmtCursor
toEnum 231 = DeclStmtCursor
toEnum 232 = OMPParallelDirectiveCursor
toEnum 300 = TranslationUnitCursor
toEnum 400 = UnexposedAttrCursor
toEnum 401 = IBActionAttrCursor
toEnum 402 = IBOutletAttrCursor
toEnum 403 = IBOutletCollectionAttrCursor
toEnum 404 = CXXFinalAttrCursor
toEnum 405 = CXXOverrideAttrCursor
toEnum 406 = AnnotateAttrCursor
toEnum 407 = AsmLabelAttrCursor
toEnum 408 = PackedAttrCursor
toEnum 500 = PreprocessingDirectiveCursor
toEnum 501 = MacroDefinitionCursor
toEnum 502 = MacroExpansionCursor
toEnum 503 = InclusionDirectiveCursor
toEnum 600 = ModuleImportDeclCursor
toEnum unmatched = error ("CursorKind.toEnum: Cannot match " ++ show unmatched)
firstDeclCursor, lastDeclCursor, firstRefCursor, lastRefCursor :: CursorKind
firstInvalidCursor, lastInvalidCursor, firstExprCursor, lastExprCursor :: CursorKind
firstStmtCursor, lastStmtCursor, firstAttrCursor, lastAttrCursor :: CursorKind
firstPreprocessingCursor, lastPreprocessingCursor :: CursorKind
firstExtraDeclCursor, lastExtraDeclCursor :: CursorKind
firstDeclCursor = UnexposedDeclCursor
lastDeclCursor = CXXAccessSpecifierCursor
firstRefCursor = ObjCSuperClassRefCursor
lastRefCursor = VariableRefCursor
firstInvalidCursor = InvalidFileCursor
lastInvalidCursor = InvalidCodeCursor
firstExprCursor = UnexposedExprCursor
lastExprCursor = ObjCSelfExprCursor
firstStmtCursor = UnexposedStmtCursor
lastStmtCursor = OMPParallelDirectiveCursor
firstAttrCursor = UnexposedAttrCursor
lastAttrCursor = PackedAttrCursor
firstPreprocessingCursor = PreprocessingDirectiveCursor
lastPreprocessingCursor = InclusionDirectiveCursor
firstExtraDeclCursor = ModuleImportDeclCursor
lastExtraDeclCursor = ModuleImportDeclCursor
gccAsmStmtCursor, macroInstantiationCursor :: CursorKind
gccAsmStmtCursor = AsmStmtCursor
macroInstantiationCursor = MacroExpansionCursor
data Comment s = Comment !(Ptr ()) !(Ptr ())
deriving (Eq, Ord, Typeable)
instance ClangValue Comment
instance Storable (Comment s) where
sizeOf _ = sizeOfCXComment
alignment _ = alignOfCXComment
peek p = do
astNode <- (\ptr -> do {C2HSImp.peekByteOff ptr 0 :: IO (C2HSImp.Ptr ())}) p
tu <- (\ptr -> do {C2HSImp.peekByteOff ptr 8 :: IO (C2HSImp.Ptr ())}) p
return $! Comment astNode tu
poke p (Comment astNode tu)= do
(\ptr val -> do {C2HSImp.pokeByteOff ptr 0 (val :: (C2HSImp.Ptr ()))}) p astNode
(\ptr val -> do {C2HSImp.pokeByteOff ptr 8 (val :: (C2HSImp.Ptr ()))}) p tu
data Cursor s = Cursor !CursorKind !Int !(Ptr ()) !(Ptr ()) !(Ptr ())
deriving (Ord, Typeable)
instance ClangValue Cursor
instance Storable (Cursor s) where
sizeOf _ = sizeOfCXCursor
alignment _ = alignOfCXCursor
peek p = do
cursorKind <- (\ptr -> do {C2HSImp.peekByteOff ptr 0 :: IO C2HSImp.CInt}) p
xdata <- (\ptr -> do {C2HSImp.peekByteOff ptr 4 :: IO C2HSImp.CInt}) p
cursorData <- (\ptr -> do {return $ ptr `C2HSImp.plusPtr` 8 :: IO (C2HSImp.Ptr (C2HSImp.Ptr ()))}) p >>= peekArray 3
return $! Cursor (toEnum (fromIntegral cursorKind)) (fromIntegral xdata) (cursorData !! 0) (cursorData !! 1) (cursorData !! 2)
poke p (Cursor kind xdata p0 p1 p2)= do
ptrsArray <- mallocArray 3
pokeArray ptrsArray [p0,p1,p2]
(\ptr val -> do {C2HSImp.pokeByteOff ptr 0 (val :: C2HSImp.CInt)}) p (fromIntegral (fromEnum kind))
(\ptr val -> do {C2HSImp.pokeByteOff ptr 4 (val :: C2HSImp.CInt)}) p (fromIntegral xdata)
(\ptr val -> do {C2HSImp.copyArray (ptr `C2HSImp.plusPtr` 8) (val :: (C2HSImp.Ptr (C2HSImp.Ptr ()))) 3}) p (castPtr ptrsArray)
instance Eq (Cursor s) where
(Cursor aK aXdata aP1 aP2 aP3) == (Cursor bK bXdata bP1 bP2 bP3) =
(aK == bK) &&
(aXdata == bXdata) &&
(aP1 == bP1) &&
(aP2' == bP2') &&
(aP3 == bP3)
where
aP2' = if isDeclaration aK then intPtrToPtr 0 else aP2
bP2' = if isDeclaration bK then intPtrToPtr 0 else bP2
instance Hashable (Cursor s) where
hashWithSalt salt (Cursor k _ p1 p2 _) =
let p = if isExpression k || isStatement k then p2 else p1
kindHash = hashWithSalt salt (fromEnum k)
pAsInt = fromIntegral (ptrToIntPtr p) :: Int
in hashWithSalt kindHash pAsInt
getNullCursor :: ClangBase m => ClangT s m (Cursor s)
getNullCursor =
return $ Cursor InvalidFileCursor 0 (intPtrToPtr 0) (intPtrToPtr 0) (intPtrToPtr 0)
clang_getTranslationUnitCursor :: (Ptr ()) -> IO ((Ptr (Cursor s)))
clang_getTranslationUnitCursor a1 =
let {a1' = id a1} in
clang_getTranslationUnitCursor'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getTranslationUnitCursor :: Proxy s -> TranslationUnit s' -> IO (Cursor s)
getTranslationUnitCursor _ (TranslationUnit tPtr) = clang_getTranslationUnitCursor tPtr >>= peek
cursor_isNull :: Cursor s -> Bool
cursor_isNull (Cursor k xdata p1 p2 p3)
| k == InvalidFileCursor &&
xdata == 0 &&
p1 == intPtrToPtr 0 &&
p2 == intPtrToPtr 0 &&
p3 == intPtrToPtr 0
= True
| otherwise
= False
clang_hashCursor :: (Cursor a) -> IO ((Word32))
clang_hashCursor a1 =
withVoided a1 $ \a1' ->
clang_hashCursor'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
hashCursor :: Cursor s -> IO Word32
hashCursor c = clang_hashCursor c
getCursorKind :: Cursor s -> CursorKind
getCursorKind (Cursor k _ _ _ _) = k
isDeclaration :: CursorKind -> Bool
isDeclaration k =
(k >= firstDeclCursor && k <= lastDeclCursor) ||
(k >= firstExtraDeclCursor && k <= lastExtraDeclCursor)
isReference :: CursorKind -> Bool
isReference k =
(k >= firstRefCursor && k <= lastRefCursor)
isExpression :: CursorKind -> Bool
isExpression k =
(k >= firstExprCursor && k <= lastExprCursor)
isStatement :: CursorKind -> Bool
isStatement k =
(k >= firstStmtCursor && k <= lastStmtCursor)
isAttribute :: CursorKind -> Bool
isAttribute k =
(k >= firstAttrCursor && k <= lastAttrCursor)
isInvalid :: CursorKind -> Bool
isInvalid k =
(k >= firstInvalidCursor && k <= lastInvalidCursor)
isTranslationUnit :: CursorKind -> Bool
isTranslationUnit TranslationUnitCursor = True
isTranslationUnit _ = False
isPreprocessing :: CursorKind -> Bool
isPreprocessing k =
(k >= firstPreprocessingCursor && k <= lastPreprocessingCursor)
isUnexposed :: CursorKind -> Bool
isUnexposed k =
(k >= firstPreprocessingCursor && k <= lastPreprocessingCursor)
data LinkageKind = Linkage_Invalid
| Linkage_NoLinkage
| Linkage_Internal
| Linkage_UniqueExternal
| Linkage_External
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum LinkageKind where
succ Linkage_Invalid = Linkage_NoLinkage
succ Linkage_NoLinkage = Linkage_Internal
succ Linkage_Internal = Linkage_UniqueExternal
succ Linkage_UniqueExternal = Linkage_External
succ Linkage_External = error "LinkageKind.succ: Linkage_External has no successor"
pred Linkage_NoLinkage = Linkage_Invalid
pred Linkage_Internal = Linkage_NoLinkage
pred Linkage_UniqueExternal = Linkage_Internal
pred Linkage_External = Linkage_UniqueExternal
pred Linkage_Invalid = error "LinkageKind.pred: Linkage_Invalid has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from Linkage_External
fromEnum Linkage_Invalid = 0
fromEnum Linkage_NoLinkage = 1
fromEnum Linkage_Internal = 2
fromEnum Linkage_UniqueExternal = 3
fromEnum Linkage_External = 4
toEnum 0 = Linkage_Invalid
toEnum 1 = Linkage_NoLinkage
toEnum 2 = Linkage_Internal
toEnum 3 = Linkage_UniqueExternal
toEnum 4 = Linkage_External
toEnum unmatched = error ("LinkageKind.toEnum: Cannot match " ++ show unmatched)
clang_getCursorLinkage :: (Cursor a) -> IO ((Int))
clang_getCursorLinkage a1 =
withVoided a1 $ \a1' ->
clang_getCursorLinkage'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getCursorLinkage :: Cursor s -> IO LinkageKind
getCursorLinkage c = clang_getCursorLinkage c >>= return . toEnum
clang_getCursorAvailability :: (Cursor a) -> IO ((Int))
clang_getCursorAvailability a1 =
withVoided a1 $ \a1' ->
clang_getCursorAvailability'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getCursorAvailability :: Cursor s -> IO AvailabilityKind
getCursorAvailability c = clang_getCursorAvailability c >>= return . toEnum
data PlatformAvailability = PlatformAvailability
{ availabilityPlatform :: !B.ByteString
, availabilityIntroduced :: !Version
, availabilityDeprecated :: !Version
, availabilityObsoleted :: !Version
, availabilityIsUnavailable :: !Bool
, availabilityMessage :: !B.ByteString
} deriving (Eq, Ord, Typeable)
instance Storable PlatformAvailability where
sizeOf _ = sizeOfCXPlatformAvailability
alignment _ = alignOfCXPlatformAvailability
peek p = do
(ClangString platD platF) <- peekByteOff p offsetCXPlatformAvailabilityPlatform
platform <- B.packCString =<< getCStringPtr platD platF
introduced <- peekByteOff p offsetCXPlatformAvailabilityIntroduced
deprecated <- peekByteOff p offsetCXPlatformAvailabilityDeprecated
obsoleted <- peekByteOff p offsetCXPlatformAvailabilityObsoleted
intUnavailable :: Int <- fromCInt <$> peekByteOff p offsetCXPlatformAvailabilityUnavailable
(ClangString msgD msgF) <- peekByteOff p offsetCXPlatformAvailabilityMessage
message <- B.packCString =<< getCStringPtr msgD msgF
return $! PlatformAvailability platform introduced deprecated obsoleted
(if intUnavailable == 0 then False else True)
message
poke _ _ = undefined
clang_disposeCXPlatformAvailability :: (Ptr ()) -> IO ()
clang_disposeCXPlatformAvailability a1 =
let {a1' = id a1} in
clang_disposeCXPlatformAvailability'_ a1' >>
return ()
disposeCXPlatformAvailability :: Ptr PlatformAvailability -> IO ()
disposeCXPlatformAvailability p = clang_disposeCXPlatformAvailability (castPtr p)
clang_getCursorPlatformAvailability :: (Cursor a) -> (Ptr ()) -> (Ptr ()) -> (Ptr ()) -> (Int) -> IO ((Int), (CInt), (CInt))
clang_getCursorPlatformAvailability a1 a3 a5 a6 a7 =
withVoided a1 $ \a1' ->
alloca $ \a2' ->
let {a3' = id a3} in
alloca $ \a4' ->
let {a5' = id a5} in
let {a6' = id a6} in
let {a7' = fromIntegral a7} in
clang_getCursorPlatformAvailability'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
let {res' = fromIntegral res} in
peek a2'>>= \a2'' ->
peek a4'>>= \a4'' ->
return (res', a2'', a4'')
unsafe_getCursorPlatformAvailability :: Cursor s' -> Ptr PlatformAvailability -> Int -> IO (Bool, ClangString (), Bool, ClangString (), Int)
unsafe_getCursorPlatformAvailability c dest destLen =
alloca (\(dMsgPtr :: (Ptr (ClangString ()))) ->
alloca (\(uMsgPtr :: (Ptr (ClangString ()))) -> do
(size, ad, au) <- clang_getCursorPlatformAvailability
c
(castPtr dMsgPtr)
(castPtr uMsgPtr)
(castPtr dest)
destLen
dm <- peek dMsgPtr
um <- peek uMsgPtr
return (toBool ad, dm, toBool au, um, size)))
data PlatformAvailabilityInfo s = PlatformAvailabilityInfo
{ availabilityAlwaysDeprecated :: !Bool
, availabilityDeprecatedMessage :: !(ClangString s)
, availabilityAlwaysUnavailable :: !Bool
, availabilityUnavailableMessage :: !(ClangString s)
, availabilityInfo :: ![PlatformAvailability]
} deriving (Eq, Ord, Typeable)
instance ClangValue PlatformAvailabilityInfo
getCursorPlatformAvailability :: ClangBase m => Cursor s'
-> ClangT s m (PlatformAvailabilityInfo s)
getCursorPlatformAvailability c = do
(ad, dMsg, au, uMsg, infos) <-
liftIO $ allocaArray maxPlatformAvailability $ \p -> do
(ad, dMsg, au, uMsg, outSize) <-
unsafe_getCursorPlatformAvailability c p maxPlatformAvailability
let count = min outSize maxPlatformAvailability
infos <- peekArray count p
forM_ [0..(count 1)] $ \idx -> do
disposeCXPlatformAvailability (advancePtr p idx)
return (ad, dMsg, au, uMsg, infos)
dMsg' <- registerClangString $ return dMsg
uMsg' <- registerClangString $ return uMsg
return $ PlatformAvailabilityInfo ad dMsg' au uMsg' infos
where
maxPlatformAvailability = 32
data LanguageKind = Language_Invalid
| Language_C
| Language_ObjC
| Language_CPlusPlus
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum LanguageKind where
succ Language_Invalid = Language_C
succ Language_C = Language_ObjC
succ Language_ObjC = Language_CPlusPlus
succ Language_CPlusPlus = error "LanguageKind.succ: Language_CPlusPlus has no successor"
pred Language_C = Language_Invalid
pred Language_ObjC = Language_C
pred Language_CPlusPlus = Language_ObjC
pred Language_Invalid = error "LanguageKind.pred: Language_Invalid has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from Language_CPlusPlus
fromEnum Language_Invalid = 0
fromEnum Language_C = 1
fromEnum Language_ObjC = 2
fromEnum Language_CPlusPlus = 3
toEnum 0 = Language_Invalid
toEnum 1 = Language_C
toEnum 2 = Language_ObjC
toEnum 3 = Language_CPlusPlus
toEnum unmatched = error ("LanguageKind.toEnum: Cannot match " ++ show unmatched)
clang_getCursorLanguage :: (Cursor a) -> IO ((Int))
clang_getCursorLanguage a1 =
withVoided a1 $ \a1' ->
clang_getCursorLanguage'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getCursorLanguage :: Cursor s -> IO LanguageKind
getCursorLanguage c = clang_getCursorLanguage c >>= return . toEnum
clang_Cursor_getTranslationUnit :: (Cursor a) -> IO ((Ptr ()))
clang_Cursor_getTranslationUnit a1 =
withVoided a1 $ \a1' ->
clang_Cursor_getTranslationUnit'_ a1' >>= \res ->
let {res' = id res} in
return (res')
unsafe_Cursor_getTranslationUnit :: Cursor s -> IO (TranslationUnit ())
unsafe_Cursor_getTranslationUnit c =
clang_Cursor_getTranslationUnit c >>= return . mkTranslationUnit
cursor_getTranslationUnit :: ClangBase m => Cursor s' -> ClangT s m (TranslationUnit s)
cursor_getTranslationUnit c = liftIO $ unsafeCoerce <$> unsafe_Cursor_getTranslationUnit c
newtype CursorSet s = CursorSet { unCursorSet :: Ptr () }
deriving (Eq, Ord, Typeable)
instance ClangValue CursorSet
clang_disposeCXCursorSet :: (Ptr ()) -> IO ()
clang_disposeCXCursorSet a1 =
let {a1' = id a1} in
clang_disposeCXCursorSet'_ a1' >>
return ()
disposeCXCursorSet :: CursorSet s -> IO ()
disposeCXCursorSet cs = clang_disposeCXCursorSet (unCursorSet cs)
registerCursorSet :: ClangBase m => IO (CursorSet ()) -> ClangT s m (CursorSet s)
registerCursorSet action = do
(_, idx) <- clangAllocate (action >>= return . unsafeCoerce)
(\i -> disposeCXCursorSet i)
return idx
clang_createCXCursorSet :: IO ((Ptr ()))
clang_createCXCursorSet =
clang_createCXCursorSet'_ >>= \res ->
let {res' = id res} in
return (res')
unsafe_createCXCursorSet :: IO (CursorSet ())
unsafe_createCXCursorSet = clang_createCXCursorSet >>= return . CursorSet
createCXCursorSet :: ClangBase m => ClangT s m (CursorSet s)
createCXCursorSet = registerCursorSet unsafe_createCXCursorSet
clang_CXCursorSet_contains :: (Ptr ()) -> (Cursor a) -> IO ((Bool))
clang_CXCursorSet_contains a1 a2 =
let {a1' = id a1} in
withVoided a2 $ \a2' ->
clang_CXCursorSet_contains'_ a1' a2' >>= \res ->
let {res' = toBool res} in
return (res')
cXCursorSet_contains :: CursorSet s -> Cursor s' -> IO Bool
cXCursorSet_contains cs c =
clang_CXCursorSet_contains (unCursorSet cs) c
clang_CXCursorSet_insert :: (Ptr ()) -> (Cursor a) -> IO ((Bool))
clang_CXCursorSet_insert a1 a2 =
let {a1' = id a1} in
withVoided a2 $ \a2' ->
clang_CXCursorSet_insert'_ a1' a2' >>= \res ->
let {res' = toBool res} in
return (res')
cXCursorSet_insert :: CursorSet s -> Cursor s' -> IO Bool
cXCursorSet_insert cs c =
clang_CXCursorSet_insert (unCursorSet cs) c
clang_getCursorSemanticParent :: (Cursor a) -> IO ((Ptr (Cursor s)))
clang_getCursorSemanticParent a1 =
withVoided a1 $ \a1' ->
clang_getCursorSemanticParent'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getCursorSemanticParent :: Proxy s -> Cursor s' -> IO (Cursor s)
getCursorSemanticParent _ c =
clang_getCursorSemanticParent c >>= peek
clang_getCursorLexicalParent :: (Cursor a) -> IO ((Ptr (Cursor s)))
clang_getCursorLexicalParent a1 =
withVoided a1 $ \a1' ->
clang_getCursorLexicalParent'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getCursorLexicalParent :: Proxy s -> Cursor s' -> IO (Cursor s)
getCursorLexicalParent _ c =
clang_getCursorLexicalParent c >>= peek
clang_disposeOverriddenCursors :: (Ptr ()) -> IO ()
clang_disposeOverriddenCursors a1 =
let {a1' = id a1} in
clang_disposeOverriddenCursors'_ a1' >>
return ()
disposeOverridden :: CursorList s -> IO ()
disposeOverridden cl =
let (csPtr, _) = fromCursorList cl in
clang_disposeOverriddenCursors csPtr
registerOverriddenList :: ClangBase m => IO UnsafeCursorList -> ClangT s m (CursorList s)
registerOverriddenList action = do
(_, cursorList) <- clangAllocate (action >>= cursorListToVector) disposeOverridden
return cursorList
clang_getOverriddenCursors :: (Cursor a) -> (Ptr (Ptr ())) -> IO ((CUInt))
clang_getOverriddenCursors a1 a2 =
withVoided a1 $ \a1' ->
let {a2' = id a2} in
alloca $ \a3' ->
clang_getOverriddenCursors'_ a1' a2' a3' >>
peek a3'>>= \a3'' ->
return (a3'')
unsafe_getOverriddenCursors :: Cursor s -> IO UnsafeCursorList
unsafe_getOverriddenCursors c = do
cxListPtr <- mallocBytes (sizeOf (undefined :: (Ptr (Ptr (Cursor s)))))
n <- clang_getOverriddenCursors c (castPtr cxListPtr)
free cxListPtr
return (toCursorList (cxListPtr, (fromIntegral n)))
getOverriddenCursors :: ClangBase m => Cursor s' -> ClangT s m (CursorList s)
getOverriddenCursors = registerOverriddenList . unsafe_getOverriddenCursors
clang_getIncludedFile :: (Cursor a) -> IO ((Ptr ()))
clang_getIncludedFile a1 =
withVoided a1 $ \a1' ->
clang_getIncludedFile'_ a1' >>= \res ->
let {res' = id res} in
return (res')
getIncludedFile :: Proxy s -> Cursor s' -> IO (Maybe (File s))
getIncludedFile _ c =
clang_getIncludedFile c >>= return . maybeFile . File . castPtr
clang_getCursor :: (Ptr ()) -> (SourceLocation a) -> IO ((Ptr (Cursor s)))
clang_getCursor a1 a2 =
let {a1' = id a1} in
withVoided a2 $ \a2' ->
clang_getCursor'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
getCursor :: Proxy s -> TranslationUnit s' -> SourceLocation s'' -> IO (Cursor s)
getCursor _ t s = clang_getCursor (unTranslationUnit t) s >>= peek
clang_getCursorLocation :: (Cursor a) -> IO ((Ptr (SourceLocation s)))
clang_getCursorLocation a1 =
withVoided a1 $ \a1' ->
clang_getCursorLocation'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getCursorLocation :: Proxy s -> Cursor s' -> IO (SourceLocation s)
getCursorLocation _ c =
clang_getCursorLocation c>>= peek
getCursorSpellingLocation :: Proxy s -> Cursor s' -> IO (Maybe (File s), Int, Int, Int)
getCursorSpellingLocation _ c =
allocaBytes 8 (\ptrToFilePtr ->
alloca (\(linePtr :: (Ptr CUInt)) ->
alloca (\(columnPtr :: (Ptr CUInt)) ->
alloca (\(offsetPtr :: (Ptr CUInt)) -> do
slPtr <- clang_getCursorLocation c
peek slPtr >>= \sl -> clang_getSpellingLocation sl ptrToFilePtr linePtr columnPtr offsetPtr
filePtr <- (\ptr -> do {C2HSImp.peekByteOff ptr 0 :: IO (C2HSImp.Ptr ())}) ptrToFilePtr
let _maybeFile = maybeFile (File filePtr)
line <- peek linePtr
column <- peek columnPtr
offset <- peek offsetPtr
return (_maybeFile, fromIntegral line, fromIntegral column, fromIntegral offset)))))
clang_getCursorExtent :: (Cursor a) -> IO ((Ptr (SourceRange s)))
clang_getCursorExtent a1 =
withVoided a1 $ \a1' ->
clang_getCursorExtent'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getCursorExtent :: Proxy s -> Cursor s' -> IO (SourceRange s)
getCursorExtent _ c =
clang_getCursorExtent c >>= peek
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_Complex
| Type_Pointer
| Type_BlockPointer
| Type_LValueReference
| Type_RValueReference
| Type_Record
| Type_Enum
| Type_Typedef
| Type_ObjCInterface
| Type_ObjCObjectPointer
| Type_FunctionNoProto
| Type_FunctionProto
| Type_ConstantArray
| Type_Vector
| Type_IncompleteArray
| Type_VariableArray
| Type_DependentSizedArray
| Type_MemberPointer
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum TypeKind where
succ Type_Invalid = Type_Unexposed
succ Type_Unexposed = Type_Void
succ Type_Void = Type_Bool
succ Type_Bool = Type_Char_U
succ Type_Char_U = Type_UChar
succ Type_UChar = Type_Char16
succ Type_Char16 = Type_Char32
succ Type_Char32 = Type_UShort
succ Type_UShort = Type_UInt
succ Type_UInt = Type_ULong
succ Type_ULong = Type_ULongLong
succ Type_ULongLong = Type_UInt128
succ Type_UInt128 = Type_Char_S
succ Type_Char_S = Type_SChar
succ Type_SChar = Type_WChar
succ Type_WChar = Type_Short
succ Type_Short = Type_Int
succ Type_Int = Type_Long
succ Type_Long = Type_LongLong
succ Type_LongLong = Type_Int128
succ Type_Int128 = Type_Float
succ Type_Float = Type_Double
succ Type_Double = Type_LongDouble
succ Type_LongDouble = Type_NullPtr
succ Type_NullPtr = Type_Overload
succ Type_Overload = Type_Dependent
succ Type_Dependent = Type_ObjCId
succ Type_ObjCId = Type_ObjCClass
succ Type_ObjCClass = Type_ObjCSel
succ Type_ObjCSel = Type_Complex
succ Type_Complex = Type_Pointer
succ Type_Pointer = Type_BlockPointer
succ Type_BlockPointer = Type_LValueReference
succ Type_LValueReference = Type_RValueReference
succ Type_RValueReference = Type_Record
succ Type_Record = Type_Enum
succ Type_Enum = Type_Typedef
succ Type_Typedef = Type_ObjCInterface
succ Type_ObjCInterface = Type_ObjCObjectPointer
succ Type_ObjCObjectPointer = Type_FunctionNoProto
succ Type_FunctionNoProto = Type_FunctionProto
succ Type_FunctionProto = Type_ConstantArray
succ Type_ConstantArray = Type_Vector
succ Type_Vector = Type_IncompleteArray
succ Type_IncompleteArray = Type_VariableArray
succ Type_VariableArray = Type_DependentSizedArray
succ Type_DependentSizedArray = Type_MemberPointer
succ Type_MemberPointer = error "TypeKind.succ: Type_MemberPointer has no successor"
pred Type_Unexposed = Type_Invalid
pred Type_Void = Type_Unexposed
pred Type_Bool = Type_Void
pred Type_Char_U = Type_Bool
pred Type_UChar = Type_Char_U
pred Type_Char16 = Type_UChar
pred Type_Char32 = Type_Char16
pred Type_UShort = Type_Char32
pred Type_UInt = Type_UShort
pred Type_ULong = Type_UInt
pred Type_ULongLong = Type_ULong
pred Type_UInt128 = Type_ULongLong
pred Type_Char_S = Type_UInt128
pred Type_SChar = Type_Char_S
pred Type_WChar = Type_SChar
pred Type_Short = Type_WChar
pred Type_Int = Type_Short
pred Type_Long = Type_Int
pred Type_LongLong = Type_Long
pred Type_Int128 = Type_LongLong
pred Type_Float = Type_Int128
pred Type_Double = Type_Float
pred Type_LongDouble = Type_Double
pred Type_NullPtr = Type_LongDouble
pred Type_Overload = Type_NullPtr
pred Type_Dependent = Type_Overload
pred Type_ObjCId = Type_Dependent
pred Type_ObjCClass = Type_ObjCId
pred Type_ObjCSel = Type_ObjCClass
pred Type_Complex = Type_ObjCSel
pred Type_Pointer = Type_Complex
pred Type_BlockPointer = Type_Pointer
pred Type_LValueReference = Type_BlockPointer
pred Type_RValueReference = Type_LValueReference
pred Type_Record = Type_RValueReference
pred Type_Enum = Type_Record
pred Type_Typedef = Type_Enum
pred Type_ObjCInterface = Type_Typedef
pred Type_ObjCObjectPointer = Type_ObjCInterface
pred Type_FunctionNoProto = Type_ObjCObjectPointer
pred Type_FunctionProto = Type_FunctionNoProto
pred Type_ConstantArray = Type_FunctionProto
pred Type_Vector = Type_ConstantArray
pred Type_IncompleteArray = Type_Vector
pred Type_VariableArray = Type_IncompleteArray
pred Type_DependentSizedArray = Type_VariableArray
pred Type_MemberPointer = Type_DependentSizedArray
pred Type_Invalid = error "TypeKind.pred: Type_Invalid has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from Type_MemberPointer
fromEnum Type_Invalid = 0
fromEnum Type_Unexposed = 1
fromEnum Type_Void = 2
fromEnum Type_Bool = 3
fromEnum Type_Char_U = 4
fromEnum Type_UChar = 5
fromEnum Type_Char16 = 6
fromEnum Type_Char32 = 7
fromEnum Type_UShort = 8
fromEnum Type_UInt = 9
fromEnum Type_ULong = 10
fromEnum Type_ULongLong = 11
fromEnum Type_UInt128 = 12
fromEnum Type_Char_S = 13
fromEnum Type_SChar = 14
fromEnum Type_WChar = 15
fromEnum Type_Short = 16
fromEnum Type_Int = 17
fromEnum Type_Long = 18
fromEnum Type_LongLong = 19
fromEnum Type_Int128 = 20
fromEnum Type_Float = 21
fromEnum Type_Double = 22
fromEnum Type_LongDouble = 23
fromEnum Type_NullPtr = 24
fromEnum Type_Overload = 25
fromEnum Type_Dependent = 26
fromEnum Type_ObjCId = 27
fromEnum Type_ObjCClass = 28
fromEnum Type_ObjCSel = 29
fromEnum Type_Complex = 100
fromEnum Type_Pointer = 101
fromEnum Type_BlockPointer = 102
fromEnum Type_LValueReference = 103
fromEnum Type_RValueReference = 104
fromEnum Type_Record = 105
fromEnum Type_Enum = 106
fromEnum Type_Typedef = 107
fromEnum Type_ObjCInterface = 108
fromEnum Type_ObjCObjectPointer = 109
fromEnum Type_FunctionNoProto = 110
fromEnum Type_FunctionProto = 111
fromEnum Type_ConstantArray = 112
fromEnum Type_Vector = 113
fromEnum Type_IncompleteArray = 114
fromEnum Type_VariableArray = 115
fromEnum Type_DependentSizedArray = 116
fromEnum Type_MemberPointer = 117
toEnum 0 = Type_Invalid
toEnum 1 = Type_Unexposed
toEnum 2 = Type_Void
toEnum 3 = Type_Bool
toEnum 4 = Type_Char_U
toEnum 5 = Type_UChar
toEnum 6 = Type_Char16
toEnum 7 = Type_Char32
toEnum 8 = Type_UShort
toEnum 9 = Type_UInt
toEnum 10 = Type_ULong
toEnum 11 = Type_ULongLong
toEnum 12 = Type_UInt128
toEnum 13 = Type_Char_S
toEnum 14 = Type_SChar
toEnum 15 = Type_WChar
toEnum 16 = Type_Short
toEnum 17 = Type_Int
toEnum 18 = Type_Long
toEnum 19 = Type_LongLong
toEnum 20 = Type_Int128
toEnum 21 = Type_Float
toEnum 22 = Type_Double
toEnum 23 = Type_LongDouble
toEnum 24 = Type_NullPtr
toEnum 25 = Type_Overload
toEnum 26 = Type_Dependent
toEnum 27 = Type_ObjCId
toEnum 28 = Type_ObjCClass
toEnum 29 = Type_ObjCSel
toEnum 100 = Type_Complex
toEnum 101 = Type_Pointer
toEnum 102 = Type_BlockPointer
toEnum 103 = Type_LValueReference
toEnum 104 = Type_RValueReference
toEnum 105 = Type_Record
toEnum 106 = Type_Enum
toEnum 107 = Type_Typedef
toEnum 108 = Type_ObjCInterface
toEnum 109 = Type_ObjCObjectPointer
toEnum 110 = Type_FunctionNoProto
toEnum 111 = Type_FunctionProto
toEnum 112 = Type_ConstantArray
toEnum 113 = Type_Vector
toEnum 114 = Type_IncompleteArray
toEnum 115 = Type_VariableArray
toEnum 116 = Type_DependentSizedArray
toEnum 117 = Type_MemberPointer
toEnum unmatched = error ("TypeKind.toEnum: Cannot match " ++ show unmatched)
type_FirstBuiltin, type_LastBuiltin :: TypeKind
type_FirstBuiltin = Type_Void
type_LastBuiltin = Type_ObjCSel
data CallingConv = CallingConv_Default
| CallingConv_C
| CallingConv_X86StdCall
| CallingConv_X86FastCall
| CallingConv_X86ThisCall
| CallingConv_X86Pascal
| CallingConv_AAPCS
| CallingConv_AAPCS_VFP
| CallingConv_PnaclCall
| CallingConv_IntelOclBic
| CallingConv_X86_64Win64
| CallingConv_X86_64SysV
| CallingConv_Invalid
| CallingConv_Unexposed
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum CallingConv where
succ CallingConv_Default = CallingConv_C
succ CallingConv_C = CallingConv_X86StdCall
succ CallingConv_X86StdCall = CallingConv_X86FastCall
succ CallingConv_X86FastCall = CallingConv_X86ThisCall
succ CallingConv_X86ThisCall = CallingConv_X86Pascal
succ CallingConv_X86Pascal = CallingConv_AAPCS
succ CallingConv_AAPCS = CallingConv_AAPCS_VFP
succ CallingConv_AAPCS_VFP = CallingConv_PnaclCall
succ CallingConv_PnaclCall = CallingConv_IntelOclBic
succ CallingConv_IntelOclBic = CallingConv_X86_64Win64
succ CallingConv_X86_64Win64 = CallingConv_X86_64SysV
succ CallingConv_X86_64SysV = CallingConv_Invalid
succ CallingConv_Invalid = CallingConv_Unexposed
succ CallingConv_Unexposed = error "CallingConv.succ: CallingConv_Unexposed has no successor"
pred CallingConv_C = CallingConv_Default
pred CallingConv_X86StdCall = CallingConv_C
pred CallingConv_X86FastCall = CallingConv_X86StdCall
pred CallingConv_X86ThisCall = CallingConv_X86FastCall
pred CallingConv_X86Pascal = CallingConv_X86ThisCall
pred CallingConv_AAPCS = CallingConv_X86Pascal
pred CallingConv_AAPCS_VFP = CallingConv_AAPCS
pred CallingConv_PnaclCall = CallingConv_AAPCS_VFP
pred CallingConv_IntelOclBic = CallingConv_PnaclCall
pred CallingConv_X86_64Win64 = CallingConv_IntelOclBic
pred CallingConv_X86_64SysV = CallingConv_X86_64Win64
pred CallingConv_Invalid = CallingConv_X86_64SysV
pred CallingConv_Unexposed = CallingConv_Invalid
pred CallingConv_Default = error "CallingConv.pred: CallingConv_Default has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from CallingConv_Unexposed
fromEnum CallingConv_Default = 0
fromEnum CallingConv_C = 1
fromEnum CallingConv_X86StdCall = 2
fromEnum CallingConv_X86FastCall = 3
fromEnum CallingConv_X86ThisCall = 4
fromEnum CallingConv_X86Pascal = 5
fromEnum CallingConv_AAPCS = 6
fromEnum CallingConv_AAPCS_VFP = 7
fromEnum CallingConv_PnaclCall = 8
fromEnum CallingConv_IntelOclBic = 9
fromEnum CallingConv_X86_64Win64 = 10
fromEnum CallingConv_X86_64SysV = 11
fromEnum CallingConv_Invalid = 100
fromEnum CallingConv_Unexposed = 200
toEnum 0 = CallingConv_Default
toEnum 1 = CallingConv_C
toEnum 2 = CallingConv_X86StdCall
toEnum 3 = CallingConv_X86FastCall
toEnum 4 = CallingConv_X86ThisCall
toEnum 5 = CallingConv_X86Pascal
toEnum 6 = CallingConv_AAPCS
toEnum 7 = CallingConv_AAPCS_VFP
toEnum 8 = CallingConv_PnaclCall
toEnum 9 = CallingConv_IntelOclBic
toEnum 10 = CallingConv_X86_64Win64
toEnum 11 = CallingConv_X86_64SysV
toEnum 100 = CallingConv_Invalid
toEnum 200 = CallingConv_Unexposed
toEnum unmatched = error ("CallingConv.toEnum: Cannot match " ++ show unmatched)
data Type s = Type !TypeKind !(Ptr ()) !(Ptr ())
deriving (Eq, Ord, Typeable)
instance ClangValue Type
instance Storable (Type s) where
sizeOf _ = 24
alignment _ = 8
peek p = do
kindCInt <- (\ptr -> do {C2HSImp.peekByteOff ptr 0 :: IO C2HSImp.CInt}) p
ptrsArray <- (\ptr -> do {return $ ptr `C2HSImp.plusPtr` 8 :: IO (C2HSImp.Ptr (C2HSImp.Ptr ()))}) p >>= peekArray 2
return $! Type (toEnum (fromIntegral kindCInt)) (ptrsArray !! 0) (ptrsArray !! 1)
poke p (Type kind p0 p1)= do
ptrsArray <- mallocArray 2
pokeArray ptrsArray [p0,p1]
(\ptr val -> do {C2HSImp.pokeByteOff ptr 0 (val :: C2HSImp.CInt)}) p (fromIntegral (fromEnum kind))
(\ptr val -> do {C2HSImp.copyArray (ptr `C2HSImp.plusPtr` 8) (val :: (C2HSImp.Ptr (C2HSImp.Ptr ()))) 2}) p (castPtr ptrsArray)
getTypeKind :: Type s -> TypeKind
getTypeKind (Type k _ _) = k
clang_getCursorType :: (Cursor a) -> IO ((Ptr (Type s)))
clang_getCursorType a1 =
withVoided a1 $ \a1' ->
clang_getCursorType'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getCursorType :: Proxy s -> Cursor s' -> IO (Type s)
getCursorType proxy c =
clang_getCursorType c >>= peek
clang_getTypeSpelling :: (Type a) -> IO ((Ptr (ClangString ())))
clang_getTypeSpelling a1 =
withVoided a1 $ \a1' ->
clang_getTypeSpelling'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getTypeSpelling :: (Type s) -> IO (ClangString ())
unsafe_getTypeSpelling t = do
cxString <- clang_getTypeSpelling t
peek cxString
getTypeSpelling :: ClangBase m => (Type s') -> ClangT s m (ClangString s)
getTypeSpelling = registerClangString . unsafe_getTypeSpelling
clang_getTypedefDeclUnderlyingType :: (Cursor a) -> IO ((Ptr (Type s)))
clang_getTypedefDeclUnderlyingType a1 =
withVoided a1 $ \a1' ->
clang_getTypedefDeclUnderlyingType'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getTypedefDeclUnderlyingType :: Proxy s -> Cursor s' -> IO (Type s)
getTypedefDeclUnderlyingType proxy c =
clang_getTypedefDeclUnderlyingType c >>= peek
clang_getEnumDeclIntegerType :: (Cursor a) -> IO ((Ptr (Type s)))
clang_getEnumDeclIntegerType a1 =
withVoided a1 $ \a1' ->
clang_getEnumDeclIntegerType'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getEnumDeclIntegerType :: Proxy s -> Cursor s' -> IO (Type s)
getEnumDeclIntegerType proxy c =
clang_getEnumDeclIntegerType c >>= peek
clang_getEnumConstantDeclValue :: (Cursor a) -> IO ((Int64))
clang_getEnumConstantDeclValue a1 =
withVoided a1 $ \a1' ->
clang_getEnumConstantDeclValue'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getEnumConstantDeclValue :: Cursor s -> IO Int64
getEnumConstantDeclValue c = clang_getEnumConstantDeclValue c
clang_getEnumConstantDeclUnsignedValue :: (Cursor a) -> IO ((Word64))
clang_getEnumConstantDeclUnsignedValue a1 =
withVoided a1 $ \a1' ->
clang_getEnumConstantDeclUnsignedValue'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getEnumConstantDeclUnsignedValue :: Cursor s -> IO Word64
getEnumConstantDeclUnsignedValue c = clang_getEnumConstantDeclUnsignedValue c
clang_getFieldDeclBitWidth :: (Cursor a) -> IO ((Int))
clang_getFieldDeclBitWidth a1 =
withVoided a1 $ \a1' ->
clang_getFieldDeclBitWidth'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getFieldDeclBitWidth :: Cursor s -> IO Int
getFieldDeclBitWidth c = clang_getFieldDeclBitWidth c
clang_Cursor_getNumArguments :: (Cursor a) -> IO ((Int))
clang_Cursor_getNumArguments a1 =
withVoided a1 $ \a1' ->
clang_Cursor_getNumArguments'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
cursor_getNumArguments :: Cursor s -> IO Int
cursor_getNumArguments c = clang_Cursor_getNumArguments c
clang_Cursor_getArgument :: (Cursor a) -> (Int) -> IO ((Ptr (Cursor s)))
clang_Cursor_getArgument a1 a2 =
withVoided a1 $ \a1' ->
let {a2' = fromIntegral a2} in
clang_Cursor_getArgument'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
cursor_getArgument :: Proxy s -> Cursor s' -> Int -> IO (Cursor s)
cursor_getArgument _ c i = clang_Cursor_getArgument c i >>= peek
clang_equalTypes :: (Type a) -> (Type b) -> IO ((Bool))
clang_equalTypes a1 a2 =
withVoided a1 $ \a1' ->
withVoided a2 $ \a2' ->
clang_equalTypes'_ a1' a2' >>= \res ->
let {res' = toBool res} in
return (res')
equalTypes :: Type s -> Type s' -> IO Bool
equalTypes t1 t2 = clang_equalTypes t1 t2
clang_getCanonicalType :: (Type a) -> IO ((Ptr (Type s)))
clang_getCanonicalType a1 =
withVoided a1 $ \a1' ->
clang_getCanonicalType'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getCanonicalType :: Proxy s -> Type s' -> IO (Type s)
getCanonicalType proxy t = do
cPtr <- clang_getCanonicalType t
peek cPtr
clang_isConstQualifiedType :: (Type a) -> IO ((Bool))
clang_isConstQualifiedType a1 =
withVoided a1 $ \a1' ->
clang_isConstQualifiedType'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
isConstQualifiedType :: Type s -> IO Bool
isConstQualifiedType t = clang_isConstQualifiedType t
clang_isVolatileQualifiedType :: (Type a) -> IO ((Bool))
clang_isVolatileQualifiedType a1 =
withVoided a1 $ \a1' ->
clang_isVolatileQualifiedType'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
isVolatileQualifiedType :: Type s -> IO Bool
isVolatileQualifiedType t = clang_isVolatileQualifiedType t
clang_isRestrictQualifiedType :: (Type a) -> IO ((Bool))
clang_isRestrictQualifiedType a1 =
withVoided a1 $ \a1' ->
clang_isRestrictQualifiedType'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
isRestrictQualifiedType :: Type s -> IO Bool
isRestrictQualifiedType t = clang_isRestrictQualifiedType t
clang_getPointeeType :: (Type a) -> IO ((Ptr (Type s)))
clang_getPointeeType a1 =
withVoided a1 $ \a1' ->
clang_getPointeeType'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getPointeeType :: Proxy s -> Type s' -> IO (Type s)
getPointeeType proxy t = do
cPtr <- clang_getPointeeType t
peek cPtr
clang_getTypeDeclaration :: (Type a) -> IO ((Ptr (Cursor s)))
clang_getTypeDeclaration a1 =
withVoided a1 $ \a1' ->
clang_getTypeDeclaration'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getTypeDeclaration :: Proxy s -> Type s' -> IO (Cursor s)
getTypeDeclaration _ t = do
cPtr <- clang_getTypeDeclaration t
peek cPtr
clang_getDeclObjCTypeEncoding :: (Cursor a) -> IO ((Ptr (ClangString ())))
clang_getDeclObjCTypeEncoding a1 =
withVoided a1 $ \a1' ->
clang_getDeclObjCTypeEncoding'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getDeclObjCTypeEncoding :: Cursor s -> IO (ClangString ())
unsafe_getDeclObjCTypeEncoding c = clang_getDeclObjCTypeEncoding c >>= peek
getDeclObjCTypeEncoding :: ClangBase m => Cursor s' -> ClangT s m (ClangString s)
getDeclObjCTypeEncoding = registerClangString . unsafe_getDeclObjCTypeEncoding
clang_getTypeKindSpelling :: (CInt) -> IO ((Ptr (ClangString ())))
clang_getTypeKindSpelling a1 =
let {a1' = fromIntegral a1} in
clang_getTypeKindSpelling'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getTypeKindSpelling :: TypeKind -> IO (ClangString ())
unsafe_getTypeKindSpelling tk = clang_getTypeKindSpelling (fromIntegral (fromEnum tk)) >>= peek
getTypeKindSpelling :: ClangBase m => TypeKind -> ClangT s m (ClangString s)
getTypeKindSpelling = registerClangString . unsafe_getTypeKindSpelling
clang_getFunctionTypeCallingConv :: (Type a) -> IO ((CInt))
clang_getFunctionTypeCallingConv a1 =
withVoided a1 $ \a1' ->
clang_getFunctionTypeCallingConv'_ a1' >>= \res ->
let {res' = id res} in
return (res')
getFunctionTypeCallingConv :: Type s' -> IO CallingConv
getFunctionTypeCallingConv t = clang_getFunctionTypeCallingConv t >>= return . toEnum . fromIntegral
clang_getResultType :: (Type a) -> IO ((Ptr (Type s)))
clang_getResultType a1 =
withVoided a1 $ \a1' ->
clang_getResultType'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getResultType :: Proxy s -> Type s' -> IO (Type s)
getResultType proxy t = clang_getResultType t >>= peek
clang_getNumArgTypes :: (Type a) -> IO ((Int))
clang_getNumArgTypes a1 =
withVoided a1 $ \a1' ->
clang_getNumArgTypes'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getNumArgTypes :: Type s -> IO Int
getNumArgTypes t = clang_getNumArgTypes t
clang_getArgType :: (Type a) -> (Int) -> IO ((Ptr (Type s)))
clang_getArgType a1 a2 =
withVoided a1 $ \a1' ->
let {a2' = fromIntegral a2} in
clang_getArgType'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
getArgType :: Proxy s -> Type s' -> Int -> IO (Type s)
getArgType proxy t i = clang_getArgType t i >>= peek
clang_isFunctionTypeVariadic :: (Type a) -> IO ((CUInt))
clang_isFunctionTypeVariadic a1 =
withVoided a1 $ \a1' ->
clang_isFunctionTypeVariadic'_ a1' >>= \res ->
let {res' = id res} in
return (res')
isFunctionTypeVariadic :: Type s -> IO Bool
isFunctionTypeVariadic t = clang_isFunctionTypeVariadic t >>= return . (toBool :: Int -> Bool) . fromIntegral
clang_getCursorResultType :: (Cursor a) -> IO ((Ptr (Type s)))
clang_getCursorResultType a1 =
withVoided a1 $ \a1' ->
clang_getCursorResultType'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getCursorResultType :: Proxy s -> Cursor s' -> IO (Type s)
getCursorResultType p c = clang_getCursorResultType c >>= peek
clang_isPODType :: (Type a) -> IO ((Bool))
clang_isPODType a1 =
withVoided a1 $ \a1' ->
clang_isPODType'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
isPODType :: Type s -> IO Bool
isPODType t = clang_isPODType t
clang_getElementType :: (Type a) -> IO ((Ptr (Type s)))
clang_getElementType a1 =
withVoided a1 $ \a1' ->
clang_getElementType'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getElementType :: Proxy s -> Type s' -> IO (Type s)
getElementType proxy t = clang_getElementType t >>= peek
clang_getNumElements :: (Type a) -> IO ((Int64))
clang_getNumElements a1 =
withVoided a1 $ \a1' ->
clang_getNumElements'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getNumElements :: Type s -> IO Int64
getNumElements t = clang_getNumElements t
clang_getArrayElementType :: (Type a) -> IO ((Ptr (Type s)))
clang_getArrayElementType a1 =
withVoided a1 $ \a1' ->
clang_getArrayElementType'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getArrayElementType :: Proxy s -> Type s' -> IO (Type s)
getArrayElementType proxy t = clang_getArrayElementType t >>= peek
clang_getArraySize :: (Type a) -> IO ((Int64))
clang_getArraySize a1 =
withVoided a1 $ \a1' ->
clang_getArraySize'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getArraySize :: Type s -> IO Int64
getArraySize t = clang_getArraySize t
data TypeLayoutError = TypeLayoutError_InvalidFieldName
| TypeLayoutError_NotConstantSize
| TypeLayoutError_Dependent
| TypeLayoutError_Incomplete
| TypeLayoutError_Invalid
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum TypeLayoutError where
succ TypeLayoutError_InvalidFieldName = TypeLayoutError_NotConstantSize
succ TypeLayoutError_NotConstantSize = TypeLayoutError_Dependent
succ TypeLayoutError_Dependent = TypeLayoutError_Incomplete
succ TypeLayoutError_Incomplete = TypeLayoutError_Invalid
succ TypeLayoutError_Invalid = error "TypeLayoutError.succ: TypeLayoutError_Invalid has no successor"
pred TypeLayoutError_NotConstantSize = TypeLayoutError_InvalidFieldName
pred TypeLayoutError_Dependent = TypeLayoutError_NotConstantSize
pred TypeLayoutError_Incomplete = TypeLayoutError_Dependent
pred TypeLayoutError_Invalid = TypeLayoutError_Incomplete
pred TypeLayoutError_InvalidFieldName = error "TypeLayoutError.pred: TypeLayoutError_InvalidFieldName has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from TypeLayoutError_Invalid
fromEnum TypeLayoutError_InvalidFieldName = (5)
fromEnum TypeLayoutError_NotConstantSize = (4)
fromEnum TypeLayoutError_Dependent = (3)
fromEnum TypeLayoutError_Incomplete = (2)
fromEnum TypeLayoutError_Invalid = (1)
toEnum (5) = TypeLayoutError_InvalidFieldName
toEnum (4) = TypeLayoutError_NotConstantSize
toEnum (3) = TypeLayoutError_Dependent
toEnum (2) = TypeLayoutError_Incomplete
toEnum (1) = TypeLayoutError_Invalid
toEnum unmatched = error ("TypeLayoutError.toEnum: Cannot match " ++ show unmatched)
int64OrLayoutError :: Int64 -> Either TypeLayoutError Int64
int64OrLayoutError v | v == 1 = Left TypeLayoutError_Invalid
| v == 2 = Left TypeLayoutError_Incomplete
| v == 3 = Left TypeLayoutError_Dependent
| v == 4 = Left TypeLayoutError_NotConstantSize
| v == 5 = Left TypeLayoutError_InvalidFieldName
| otherwise = Right v
clang_Type_getAlignOf :: (Type a) -> IO ((Int64))
clang_Type_getAlignOf a1 =
withVoided a1 $ \a1' ->
clang_Type_getAlignOf'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
type_getAlignOf :: Type s -> IO (Either TypeLayoutError Int64)
type_getAlignOf t = clang_Type_getAlignOf t >>= return . int64OrLayoutError
clang_Type_getClassType :: (Type a) -> IO ((Ptr (Type s)))
clang_Type_getClassType a1 =
withVoided a1 $ \a1' ->
clang_Type_getClassType'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
type_getClassType :: Proxy s -> Type s' -> IO (Type s)
type_getClassType proxy t = clang_getElementType t >>= peek
clang_Type_getSizeOf :: (Type a) -> IO ((Int64))
clang_Type_getSizeOf a1 =
withVoided a1 $ \a1' ->
clang_Type_getSizeOf'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
type_getSizeOf :: Type s -> IO (Either TypeLayoutError Int64)
type_getSizeOf t = clang_Type_getSizeOf t >>= return . int64OrLayoutError
clang_Type_getOffsetOf :: (Type a) -> (CString) -> IO ((Int64))
clang_Type_getOffsetOf a1 a2 =
withVoided a1 $ \a1' ->
(flip ($)) a2 $ \a2' ->
clang_Type_getOffsetOf'_ a1' a2' >>= \res ->
let {res' = fromIntegral res} in
return (res')
unsafe_Type_getOffsetOf :: Type s -> CString -> IO (Either TypeLayoutError Int64)
unsafe_Type_getOffsetOf t s = clang_Type_getOffsetOf t s >>= return . int64OrLayoutError
type_getOffsetOf :: ClangBase m => Type s' -> B.ByteString
-> ClangT s m (Either TypeLayoutError Int64)
type_getOffsetOf t field = liftIO $ B.useAsCString field $ \cField ->
unsafe_Type_getOffsetOf t cField
data RefQualifierKind = RefQualifier_None
| RefQualifier_LValue
| RefQualifier_RValue
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum RefQualifierKind where
succ RefQualifier_None = RefQualifier_LValue
succ RefQualifier_LValue = RefQualifier_RValue
succ RefQualifier_RValue = error "RefQualifierKind.succ: RefQualifier_RValue has no successor"
pred RefQualifier_LValue = RefQualifier_None
pred RefQualifier_RValue = RefQualifier_LValue
pred RefQualifier_None = error "RefQualifierKind.pred: RefQualifier_None has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from RefQualifier_RValue
fromEnum RefQualifier_None = 0
fromEnum RefQualifier_LValue = 1
fromEnum RefQualifier_RValue = 2
toEnum 0 = RefQualifier_None
toEnum 1 = RefQualifier_LValue
toEnum 2 = RefQualifier_RValue
toEnum unmatched = error ("RefQualifierKind.toEnum: Cannot match " ++ show unmatched)
clang_Type_getCXXRefQualifier :: (Type a) -> IO ((Int))
clang_Type_getCXXRefQualifier a1 =
withVoided a1 $ \a1' ->
clang_Type_getCXXRefQualifier'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
type_getCXXRefQualifier :: Type s -> IO RefQualifierKind
type_getCXXRefQualifier t = clang_Type_getCXXRefQualifier t >>= return . toEnum
clang_Cursor_isBitField :: (Cursor a) -> IO ((Bool))
clang_Cursor_isBitField a1 =
withVoided a1 $ \a1' ->
clang_Cursor_isBitField'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
isBitField :: Cursor s -> IO Bool
isBitField c = clang_Cursor_isBitField c
clang_isVirtualBase :: (Cursor a) -> IO ((Bool))
clang_isVirtualBase a1 =
withVoided a1 $ \a1' ->
clang_isVirtualBase'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
isVirtualBase :: Cursor s -> IO Bool
isVirtualBase c = clang_Cursor_isBitField c
data CXXAccessSpecifier = CXXInvalidAccessSpecifier
| CXXPublic
| CXXProtected
| CXXPrivate
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum CXXAccessSpecifier where
succ CXXInvalidAccessSpecifier = CXXPublic
succ CXXPublic = CXXProtected
succ CXXProtected = CXXPrivate
succ CXXPrivate = error "CXXAccessSpecifier.succ: CXXPrivate has no successor"
pred CXXPublic = CXXInvalidAccessSpecifier
pred CXXProtected = CXXPublic
pred CXXPrivate = CXXProtected
pred CXXInvalidAccessSpecifier = error "CXXAccessSpecifier.pred: CXXInvalidAccessSpecifier has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from CXXPrivate
fromEnum CXXInvalidAccessSpecifier = 0
fromEnum CXXPublic = 1
fromEnum CXXProtected = 2
fromEnum CXXPrivate = 3
toEnum 0 = CXXInvalidAccessSpecifier
toEnum 1 = CXXPublic
toEnum 2 = CXXProtected
toEnum 3 = CXXPrivate
toEnum unmatched = error ("CXXAccessSpecifier.toEnum: Cannot match " ++ show unmatched)
clang_getCXXAccessSpecifier :: (Cursor a) -> IO ((Int))
clang_getCXXAccessSpecifier a1 =
withVoided a1 $ \a1' ->
clang_getCXXAccessSpecifier'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getCXXAccessSpecifier :: Cursor s -> IO CXXAccessSpecifier
getCXXAccessSpecifier c = clang_getCXXAccessSpecifier c >>= return . toEnum
clang_getNumOverloadedDecls :: (Cursor a) -> IO ((CUInt))
clang_getNumOverloadedDecls a1 =
withVoided a1 $ \a1' ->
clang_getNumOverloadedDecls'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getNumOverloadedDecls :: Cursor s -> IO Int
getNumOverloadedDecls c = clang_getNumOverloadedDecls c >>= return . fromIntegral
clang_getOverloadedDecl :: (Cursor a) -> (Int) -> IO ((Ptr (Cursor s)))
clang_getOverloadedDecl a1 a2 =
withVoided a1 $ \a1' ->
let {a2' = fromIntegral a2} in
clang_getOverloadedDecl'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
getOverloadedDecl :: Proxy s -> Cursor s' -> Int -> IO (Cursor s)
getOverloadedDecl _ c i = clang_getOverloadedDecl c i >>= peek
clang_getIBOutletCollectionType :: (Cursor a) -> IO ((Ptr (Type s)))
clang_getIBOutletCollectionType a1 =
withVoided a1 $ \a1' ->
clang_getIBOutletCollectionType'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getIBOutletCollectionType :: Proxy s -> Cursor s' -> IO (Type s)
getIBOutletCollectionType proxy c = clang_getIBOutletCollectionType c >>= peek
type CursorList s = DVS.Vector (Cursor s)
instance ClangValueList Cursor
data UnsafeCursorList = UnsafeCursorList !(Ptr ()) !Int
freeCursorList' :: (Ptr ()) -> IO ()
freeCursorList' a1 =
let {a1' = id a1} in
freeCursorList''_ a1' >>
return ()
freeCursorList :: CursorList s -> IO ()
freeCursorList cl = let (ptr, _) = fromCursorList cl in freeCursorList' ptr
registerCursorList :: ClangBase m => IO UnsafeCursorList -> ClangT s m (CursorList s)
registerCursorList action = do
(_, cursorList) <- clangAllocate (action >>= cursorListToVector) freeCursorList
return cursorList
cursorListToVector :: Storable a => UnsafeCursorList -> IO (DVS.Vector a)
cursorListToVector (UnsafeCursorList cs n) = do
fptr <- newForeignPtr_ (castPtr cs)
return $ DVS.unsafeFromForeignPtr fptr 0 n
fromCursorList :: CursorList s -> (Ptr (), Int)
fromCursorList cs = let (p, _, _) = DVS.unsafeToForeignPtr cs in
(castPtr $ Foreign.ForeignPtr.Unsafe.unsafeForeignPtrToPtr p, DVS.length cs)
toCursorList :: (Ptr (), Int) -> UnsafeCursorList
toCursorList (cs, n) = UnsafeCursorList cs n
getChildren' :: (Cursor a) -> (Ptr (Ptr ())) -> IO ((CUInt))
getChildren' a1 a2 =
withVoided a1 $ \a1' ->
let {a2' = id a2} in
alloca $ \a3' ->
getChildren''_ a1' a2' a3' >>
peek a3'>>= \a3'' ->
return (a3'')
unsafe_getChildren :: Cursor s -> IO UnsafeCursorList
unsafe_getChildren c =
do
cxListPtr <- mallocBytes (sizeOf (undefined :: (Ptr (Ptr ()))))
n <- getChildren' c cxListPtr
cxList <- peek cxListPtr
free cxListPtr
return (toCursorList (cxList, fromIntegral n))
getChildren :: ClangBase m => Cursor s' -> ClangT s m (CursorList s)
getChildren = registerCursorList . unsafe_getChildren
getDescendants' :: (Cursor a) -> (Ptr (Ptr ())) -> IO ((CUInt))
getDescendants' a1 a2 =
withVoided a1 $ \a1' ->
let {a2' = id a2} in
alloca $ \a3' ->
getDescendants''_ a1' a2' a3' >>
peek a3'>>= \a3'' ->
return (a3'')
unsafe_getDescendants :: Cursor s -> IO UnsafeCursorList
unsafe_getDescendants c =
do
cxListPtr <- mallocBytes (sizeOf (undefined :: (Ptr (Cursor s))))
n <- getDescendants' c cxListPtr
cxList <- peek cxListPtr
free cxListPtr
return (toCursorList (cxList, fromIntegral n))
getDescendants :: ClangBase m => Cursor s' -> ClangT s m (CursorList s)
getDescendants = registerCursorList . unsafe_getDescendants
getDeclarations' :: (Ptr ()) -> (Ptr (Ptr ())) -> IO ((CUInt))
getDeclarations' a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
alloca $ \a3' ->
getDeclarations''_ a1' a2' a3' >>
peek a3'>>= \a3'' ->
return (a3'')
unsafe_getDeclarations :: TranslationUnit s -> IO UnsafeCursorList
unsafe_getDeclarations t = do
cxListPtr <- mallocBytes (sizeOf (undefined :: (Ptr (Ptr (Cursor ())))))
n <- getDeclarations' (unTranslationUnit t) cxListPtr
cxList <- peek cxListPtr
free cxListPtr
return (toCursorList (cxList, fromIntegral n))
getDeclarations :: ClangBase m => TranslationUnit s' -> ClangT s m (CursorList s)
getDeclarations = registerCursorList . unsafe_getDeclarations
getReferences' :: (Ptr ()) -> (Ptr (Ptr ())) -> IO ((CUInt))
getReferences' a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
alloca $ \a3' ->
getReferences''_ a1' a2' a3' >>
peek a3'>>= \a3'' ->
return (a3'')
unsafe_getReferences :: TranslationUnit s -> IO UnsafeCursorList
unsafe_getReferences t = do
cxListPtr <- mallocBytes (sizeOf (undefined :: (Ptr (Ptr ()))))
n <- getReferences' (unTranslationUnit t) cxListPtr
cxList <- peek cxListPtr
free cxListPtr
return (toCursorList (cxList, fromIntegral n))
getReferences :: ClangBase m => TranslationUnit s' -> ClangT s m (CursorList s)
getReferences = registerCursorList . unsafe_getReferences
getDeclarationsAndReferences' :: (Ptr ()) -> (Ptr (Ptr ())) -> (Ptr (Ptr ())) -> IO ((CUInt), (CUInt))
getDeclarationsAndReferences' a1 a2 a4 =
let {a1' = id a1} in
let {a2' = id a2} in
alloca $ \a3' ->
let {a4' = id a4} in
alloca $ \a5' ->
getDeclarationsAndReferences''_ a1' a2' a3' a4' a5' >>
peek a3'>>= \a3'' ->
peek a5'>>= \a5'' ->
return (a3'', a5'')
unsafe_getDeclarationsAndReferences :: TranslationUnit s -> IO (UnsafeCursorList, UnsafeCursorList)
unsafe_getDeclarationsAndReferences t =
alloca (\(declsPtr :: Ptr (Ptr ())) ->
alloca (\(refsPtr :: Ptr (Ptr ())) -> do
(nDecls, nRefs) <- getDeclarationsAndReferences' (unTranslationUnit t) (castPtr declsPtr) (castPtr refsPtr)
decls <- peek declsPtr
refs <- peek refsPtr
return ((toCursorList (decls, fromIntegral nDecls)), (toCursorList (refs, fromIntegral nRefs)))))
getDeclarationsAndReferences :: ClangBase m => TranslationUnit s'
-> ClangT s m (CursorList s, CursorList s)
getDeclarationsAndReferences tu = do
(ds, rs) <- liftIO $ unsafe_getDeclarationsAndReferences tu
(,) <$> registerCursorList (return ds) <*> registerCursorList (return rs)
data ParentedCursor s = ParentedCursor
{ parentCursor :: !(Cursor s)
, childCursor :: !(Cursor s)
} deriving (Eq, Ord, Typeable)
instance ClangValue ParentedCursor
instance Storable (ParentedCursor s) where
sizeOf _ = sizeOfParentedCursor
alignment _ = alignOfParentedCursor
peek p = do
parent <- peekByteOff p offsetParentedCursorParent
child <- peekByteOff p offsetParentedCursorCursor
return $! ParentedCursor parent child
poke p (ParentedCursor parent child) = do
pokeByteOff p offsetParentedCursorParent parent
pokeByteOff p offsetParentedCursorCursor child
type ParentedCursorList s = DVS.Vector (ParentedCursor s)
instance ClangValueList ParentedCursor
data UnsafeParentedCursorList = UnsafeParentedCursorList !(Ptr ()) !Int
freeParentedCursorList' :: (Ptr ()) -> IO ()
freeParentedCursorList' a1 =
let {a1' = id a1} in
freeParentedCursorList''_ a1' >>
return ()
freeParentedCursorList :: ParentedCursorList s -> IO ()
freeParentedCursorList pcl = let (pclPtr, _ ) = fromParentedCursorList pcl in freeParentedCursorList' pclPtr
registerParentedCursorList :: ClangBase m => IO UnsafeParentedCursorList
-> ClangT s m (ParentedCursorList s)
registerParentedCursorList action = do
(_, pcList) <- clangAllocate (action >>= mkSafe) freeParentedCursorList
return pcList
where
mkSafe (UnsafeParentedCursorList cs n) = do
fptr <- newForeignPtr_ (castPtr cs)
return $ DVS.unsafeFromForeignPtr fptr 0 n
fromParentedCursorList :: ParentedCursorList s -> (Ptr (), Int)
fromParentedCursorList cs =
let (p, _, _) = DVS.unsafeToForeignPtr cs in
(castPtr $ Foreign.ForeignPtr.Unsafe.unsafeForeignPtrToPtr p, DVS.length cs)
toParentedCursorList :: (Ptr (), Int) -> UnsafeParentedCursorList
toParentedCursorList (cs, n) = UnsafeParentedCursorList cs n
getParentedDescendants' :: (Cursor a) -> (Ptr (Ptr ())) -> IO ((CUInt))
getParentedDescendants' a1 a2 =
withVoided a1 $ \a1' ->
let {a2' = id a2} in
alloca $ \a3' ->
getParentedDescendants''_ a1' a2' a3' >>
peek a3'>>= \a3'' ->
return (a3'')
unsafe_getParentedDescendants :: Cursor s -> IO UnsafeParentedCursorList
unsafe_getParentedDescendants c =
do
cxListPtr <- mallocBytes (sizeOf (undefined :: (Ptr (Ptr ()))))
n <- getParentedDescendants' c cxListPtr
cxList <- peek cxListPtr
free cxListPtr
return (toParentedCursorList (cxList, fromIntegral n))
getParentedDescendants :: ClangBase m => Cursor s' -> ClangT s m (ParentedCursorList s)
getParentedDescendants = registerParentedCursorList . unsafe_getParentedDescendants
getParentedDeclarations' :: (Ptr ()) -> (Ptr (Ptr ())) -> IO ((CUInt))
getParentedDeclarations' a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
alloca $ \a3' ->
getParentedDeclarations''_ a1' a2' a3' >>
peek a3'>>= \a3'' ->
return (a3'')
unsafe_getParentedDeclarations :: TranslationUnit s -> IO UnsafeParentedCursorList
unsafe_getParentedDeclarations t = do
cxListPtr <- mallocBytes (sizeOf (undefined :: (Ptr (Ptr (Cursor ())))))
n <- getParentedDeclarations' (unTranslationUnit t) (castPtr cxListPtr)
cxList <- peek cxListPtr
free cxListPtr
return (toParentedCursorList (cxList, fromIntegral n))
getParentedDeclarations :: ClangBase m => TranslationUnit s' -> ClangT s m (ParentedCursorList s)
getParentedDeclarations = registerParentedCursorList . unsafe_getParentedDeclarations
getParentedReferences' :: (Ptr ()) -> (Ptr (Ptr ())) -> IO ((CUInt))
getParentedReferences' a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
alloca $ \a3' ->
getParentedReferences''_ a1' a2' a3' >>
peek a3'>>= \a3'' ->
return (a3'')
unsafe_getParentedReferences :: TranslationUnit s -> IO UnsafeParentedCursorList
unsafe_getParentedReferences t = do
cxListPtr <- mallocBytes (sizeOf (undefined :: (Ptr (Ptr ()))))
n <- getParentedReferences' (unTranslationUnit t) cxListPtr
cxList <- peek cxListPtr
free cxListPtr
return (toParentedCursorList (cxList, fromIntegral n))
getParentedReferences :: ClangBase m => TranslationUnit s' -> ClangT s m (ParentedCursorList s)
getParentedReferences = registerParentedCursorList . unsafe_getParentedReferences
getParentedDeclarationsAndReferences' :: (Ptr ()) -> (Ptr (Ptr ())) -> (Ptr (Ptr ())) -> IO ((CUInt), (CUInt))
getParentedDeclarationsAndReferences' a1 a2 a4 =
let {a1' = id a1} in
let {a2' = id a2} in
alloca $ \a3' ->
let {a4' = id a4} in
alloca $ \a5' ->
getParentedDeclarationsAndReferences''_ a1' a2' a3' a4' a5' >>
peek a3'>>= \a3'' ->
peek a5'>>= \a5'' ->
return (a3'', a5'')
unsafe_getParentedDeclarationsAndReferences :: TranslationUnit s -> IO (UnsafeParentedCursorList, UnsafeParentedCursorList)
unsafe_getParentedDeclarationsAndReferences t = do
declsPtr <- mallocBytes (sizeOf (undefined :: (Ptr (Ptr ()))))
refsPtr <- mallocBytes (sizeOf (undefined :: (Ptr (Ptr ()))))
(nDecls, nRefs) <- getParentedDeclarationsAndReferences' (unTranslationUnit t) declsPtr refsPtr
decls <- peek declsPtr
refs <- peek refsPtr
free declsPtr
free refsPtr
return ((toParentedCursorList (decls, fromIntegral nDecls)), (toParentedCursorList (refs, fromIntegral nRefs)))
getParentedDeclarationsAndReferences :: ClangBase m => TranslationUnit s'
-> ClangT s m (ParentedCursorList s, ParentedCursorList s)
getParentedDeclarationsAndReferences tu = do
(ds, rs) <- liftIO $ unsafe_getParentedDeclarationsAndReferences tu
(,) <$> registerParentedCursorList (return ds) <*> registerParentedCursorList (return rs)
clang_getCursorUSR :: (Cursor a) -> IO ((Ptr (ClangString ())))
clang_getCursorUSR a1 =
withVoided a1 $ \a1' ->
clang_getCursorUSR'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getCursorUSR :: Cursor s -> IO (ClangString ())
unsafe_getCursorUSR c =
clang_getCursorUSR c >>= peek
getCursorUSR :: ClangBase m => Cursor s' -> ClangT s m (ClangString s)
getCursorUSR = registerClangString . unsafe_getCursorUSR
clang_constructUSR_ObjCClass :: (CString) -> IO ((Ptr (ClangString ())))
clang_constructUSR_ObjCClass a1 =
(flip ($)) a1 $ \a1' ->
clang_constructUSR_ObjCClass'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_constructUSR_ObjCClass :: String -> IO (ClangString ())
unsafe_constructUSR_ObjCClass s = withCString s (\sPtr -> clang_constructUSR_ObjCClass sPtr >>= peek)
constructUSR_ObjCClass :: ClangBase m => String -> ClangT s m (ClangString s)
constructUSR_ObjCClass = registerClangString . unsafe_constructUSR_ObjCClass
clang_constructUSR_ObjCCategory :: (CString) -> (CString) -> IO ((Ptr (ClangString ())))
clang_constructUSR_ObjCCategory a1 a2 =
(flip ($)) a1 $ \a1' ->
(flip ($)) a2 $ \a2' ->
clang_constructUSR_ObjCCategory'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_constructUSR_ObjCCategory :: String -> String -> IO (ClangString ())
unsafe_constructUSR_ObjCCategory s p =
withCString s (\sPtr ->
withCString p (\pPtr ->
clang_constructUSR_ObjCCategory sPtr pPtr >>= peek))
constructUSR_ObjCCategory :: ClangBase m => String -> String -> ClangT s m (ClangString s)
constructUSR_ObjCCategory = (registerClangString .) . unsafe_constructUSR_ObjCCategory
clang_constructUSR_ObjCProtocol :: (CString) -> IO ((Ptr (ClangString ())))
clang_constructUSR_ObjCProtocol a1 =
(flip ($)) a1 $ \a1' ->
clang_constructUSR_ObjCProtocol'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_constructUSR_ObjCProtocol :: String -> IO (ClangString ())
unsafe_constructUSR_ObjCProtocol s = withCString s (\sPtr -> clang_constructUSR_ObjCProtocol sPtr >>= peek)
constructUSR_ObjCProtocol :: ClangBase m => String -> ClangT s m (ClangString s)
constructUSR_ObjCProtocol = registerClangString . unsafe_constructUSR_ObjCProtocol
clang_constructUSR_ObjCIvar :: (CString) -> (Ptr ()) -> IO ((Ptr (ClangString ())))
clang_constructUSR_ObjCIvar a1 a2 =
(flip ($)) a1 $ \a1' ->
let {a2' = id a2} in
clang_constructUSR_ObjCIvar'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_constructUSR_ObjCIvar :: String -> Ptr () -> Word32 -> IO (ClangString ())
unsafe_constructUSR_ObjCIvar s d f =
let clangString = ClangString d f in
withCString s (\sPtr -> new clangString >>= \cs -> clang_constructUSR_ObjCIvar sPtr (castPtr cs) >>= peek)
constructUSR_ObjCIvar :: ClangBase m => String -> ClangString s' -> ClangT s m (ClangString s)
constructUSR_ObjCIvar s (ClangString d f) = registerClangString $ unsafe_constructUSR_ObjCIvar s d f
clang_constructUSR_ObjCMethod :: (CString) -> (CUInt) -> (Ptr ()) -> IO ((Ptr (ClangString ())))
clang_constructUSR_ObjCMethod a1 a2 a3 =
(flip ($)) a1 $ \a1' ->
let {a2' = fromIntegral a2} in
let {a3' = id a3} in
clang_constructUSR_ObjCMethod'_ a1' a2' a3' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_constructUSR_ObjCMethod :: String -> Bool -> Ptr () -> Word32 -> IO (ClangString ())
unsafe_constructUSR_ObjCMethod s b d f =
let clangString = ClangString d f in
withCString s (\sPtr -> (new clangString >>= \cs -> clang_constructUSR_ObjCMethod sPtr (fromIntegral ((fromBool b) :: Int)) (castPtr cs) >>= peek))
constructUSR_ObjCMethod :: ClangBase m => String -> Bool -> ClangString s' -> ClangT s m (ClangString s)
constructUSR_ObjCMethod s b (ClangString d f) =
registerClangString $ unsafe_constructUSR_ObjCMethod s b d f
clang_constructUSR_ObjCProperty :: (CString) -> (Ptr ()) -> IO ((Ptr (ClangString ())))
clang_constructUSR_ObjCProperty a1 a2 =
(flip ($)) a1 $ \a1' ->
let {a2' = id a2} in
clang_constructUSR_ObjCProperty'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_constructUSR_ObjCProperty :: String -> Ptr () -> Word32 -> IO (ClangString ())
unsafe_constructUSR_ObjCProperty s d f =
let clangString = ClangString d f in
withCString s (\sPtr -> (new clangString >>= \cs -> clang_constructUSR_ObjCProperty sPtr (castPtr cs) >>= peek))
constructUSR_ObjCProperty :: ClangBase m => String -> ClangString s' -> ClangT s m (ClangString s)
constructUSR_ObjCProperty s (ClangString d f) =
registerClangString $ unsafe_constructUSR_ObjCProperty s d f
clang_getCursorSpelling :: (Cursor a) -> IO ((Ptr (ClangString ())))
clang_getCursorSpelling a1 =
withVoided a1 $ \a1' ->
clang_getCursorSpelling'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getCursorSpelling :: Cursor s -> IO (ClangString ())
unsafe_getCursorSpelling c =
clang_getCursorSpelling c >>= peek
getCursorSpelling :: ClangBase m => Cursor s' -> ClangT s m (ClangString s)
getCursorSpelling = registerClangString . unsafe_getCursorSpelling
clang_Cursor_getSpellingNameRange :: (Cursor a) -> (Int) -> (Int) -> IO ((Ptr (SourceRange s)))
clang_Cursor_getSpellingNameRange a1 a2 a3 =
withVoided a1 $ \a1' ->
let {a2' = fromIntegral a2} in
let {a3' = fromIntegral a3} in
clang_Cursor_getSpellingNameRange'_ a1' a2' a3' >>= \res ->
let {res' = castPtr res} in
return (res')
cursor_getSpellingNameRange :: Proxy s -> Cursor s' -> Int -> IO (SourceRange s)
cursor_getSpellingNameRange _ c i = clang_Cursor_getSpellingNameRange c i 0 >>= peek
clang_getCursorDisplayName :: (Cursor a) -> IO ((Ptr (ClangString ())))
clang_getCursorDisplayName a1 =
withVoided a1 $ \a1' ->
clang_getCursorDisplayName'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getCursorDisplayName :: Cursor s -> IO (ClangString ())
unsafe_getCursorDisplayName c =
clang_getCursorDisplayName c >>= peek
getCursorDisplayName :: ClangBase m => Cursor s' -> ClangT s m (ClangString s)
getCursorDisplayName = registerClangString . unsafe_getCursorDisplayName
clang_getCursorReferenced :: (Cursor a) -> IO ((Ptr (Cursor s)))
clang_getCursorReferenced a1 =
withVoided a1 $ \a1' ->
clang_getCursorReferenced'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getCursorReferenced :: Proxy s -> Cursor s' -> IO (Cursor s)
getCursorReferenced _ c =
clang_getCursorReferenced c >>= peek
clang_getCursorDefinition :: (Cursor a) -> IO ((Ptr (Cursor s)))
clang_getCursorDefinition a1 =
withVoided a1 $ \a1' ->
clang_getCursorDefinition'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getCursorDefinition :: Proxy s -> Cursor s' -> IO (Cursor s)
getCursorDefinition _ c = clang_getCursorDefinition c >>= peek
clang_isCursorDefinition :: (Cursor a) -> IO ((Bool))
clang_isCursorDefinition a1 =
withVoided a1 $ \a1' ->
clang_isCursorDefinition'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
isCursorDefinition :: Cursor s -> IO Bool
isCursorDefinition c = clang_isCursorDefinition c
clang_Cursor_isDynamicCall :: (Cursor a) -> IO ((Bool))
clang_Cursor_isDynamicCall a1 =
withVoided a1 $ \a1' ->
clang_Cursor_isDynamicCall'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
cursor_isDynamicCall :: Cursor s -> IO Bool
cursor_isDynamicCall c = clang_Cursor_isDynamicCall c
clang_getCanonicalCursor :: (Cursor a) -> IO ((Ptr (Cursor s)))
clang_getCanonicalCursor a1 =
withVoided a1 $ \a1' ->
clang_getCanonicalCursor'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getCanonicalCursor :: Proxy s -> Cursor s' -> IO (Cursor s)
getCanonicalCursor _ c =
clang_getCanonicalCursor c >>= peek
clang_Cursor_getObjCSelectorIndex :: (Cursor a) -> IO ((Int))
clang_Cursor_getObjCSelectorIndex a1 =
withVoided a1 $ \a1' ->
clang_Cursor_getObjCSelectorIndex'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
cursor_getObjCSelectorIndex :: Cursor s -> IO Int
cursor_getObjCSelectorIndex c = clang_Cursor_getObjCSelectorIndex c
clang_Cursor_getReceiverType :: (Cursor a) -> IO ((Ptr (Type s)))
clang_Cursor_getReceiverType a1 =
withVoided a1 $ \a1' ->
clang_Cursor_getReceiverType'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
cursor_getReceiverType :: Proxy s -> Cursor s' -> IO (Type s)
cursor_getReceiverType proxy c =
clang_Cursor_getReceiverType c >>= peek
data ObjCPropertyAttrKind = ObjCPropertyAttr_noattr
| ObjCPropertyAttr_readonly
| ObjCPropertyAttr_getter
| ObjCPropertyAttr_assign
| ObjCPropertyAttr_readwrite
| ObjCPropertyAttr_retain
| ObjCPropertyAttr_copy
| ObjCPropertyAttr_nonatomic
| ObjCPropertyAttr_setter
| ObjCPropertyAttr_atomic
| ObjCPropertyAttr_weak
| ObjCPropertyAttr_strong
| ObjCPropertyAttr_unsafe_unretained
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum ObjCPropertyAttrKind where
succ ObjCPropertyAttr_noattr = ObjCPropertyAttr_readonly
succ ObjCPropertyAttr_readonly = ObjCPropertyAttr_getter
succ ObjCPropertyAttr_getter = ObjCPropertyAttr_assign
succ ObjCPropertyAttr_assign = ObjCPropertyAttr_readwrite
succ ObjCPropertyAttr_readwrite = ObjCPropertyAttr_retain
succ ObjCPropertyAttr_retain = ObjCPropertyAttr_copy
succ ObjCPropertyAttr_copy = ObjCPropertyAttr_nonatomic
succ ObjCPropertyAttr_nonatomic = ObjCPropertyAttr_setter
succ ObjCPropertyAttr_setter = ObjCPropertyAttr_atomic
succ ObjCPropertyAttr_atomic = ObjCPropertyAttr_weak
succ ObjCPropertyAttr_weak = ObjCPropertyAttr_strong
succ ObjCPropertyAttr_strong = ObjCPropertyAttr_unsafe_unretained
succ ObjCPropertyAttr_unsafe_unretained = error "ObjCPropertyAttrKind.succ: ObjCPropertyAttr_unsafe_unretained has no successor"
pred ObjCPropertyAttr_readonly = ObjCPropertyAttr_noattr
pred ObjCPropertyAttr_getter = ObjCPropertyAttr_readonly
pred ObjCPropertyAttr_assign = ObjCPropertyAttr_getter
pred ObjCPropertyAttr_readwrite = ObjCPropertyAttr_assign
pred ObjCPropertyAttr_retain = ObjCPropertyAttr_readwrite
pred ObjCPropertyAttr_copy = ObjCPropertyAttr_retain
pred ObjCPropertyAttr_nonatomic = ObjCPropertyAttr_copy
pred ObjCPropertyAttr_setter = ObjCPropertyAttr_nonatomic
pred ObjCPropertyAttr_atomic = ObjCPropertyAttr_setter
pred ObjCPropertyAttr_weak = ObjCPropertyAttr_atomic
pred ObjCPropertyAttr_strong = ObjCPropertyAttr_weak
pred ObjCPropertyAttr_unsafe_unretained = ObjCPropertyAttr_strong
pred ObjCPropertyAttr_noattr = error "ObjCPropertyAttrKind.pred: ObjCPropertyAttr_noattr has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from ObjCPropertyAttr_unsafe_unretained
fromEnum ObjCPropertyAttr_noattr = 0
fromEnum ObjCPropertyAttr_readonly = 1
fromEnum ObjCPropertyAttr_getter = 2
fromEnum ObjCPropertyAttr_assign = 4
fromEnum ObjCPropertyAttr_readwrite = 8
fromEnum ObjCPropertyAttr_retain = 16
fromEnum ObjCPropertyAttr_copy = 32
fromEnum ObjCPropertyAttr_nonatomic = 64
fromEnum ObjCPropertyAttr_setter = 128
fromEnum ObjCPropertyAttr_atomic = 256
fromEnum ObjCPropertyAttr_weak = 512
fromEnum ObjCPropertyAttr_strong = 1024
fromEnum ObjCPropertyAttr_unsafe_unretained = 2048
toEnum 0 = ObjCPropertyAttr_noattr
toEnum 1 = ObjCPropertyAttr_readonly
toEnum 2 = ObjCPropertyAttr_getter
toEnum 4 = ObjCPropertyAttr_assign
toEnum 8 = ObjCPropertyAttr_readwrite
toEnum 16 = ObjCPropertyAttr_retain
toEnum 32 = ObjCPropertyAttr_copy
toEnum 64 = ObjCPropertyAttr_nonatomic
toEnum 128 = ObjCPropertyAttr_setter
toEnum 256 = ObjCPropertyAttr_atomic
toEnum 512 = ObjCPropertyAttr_weak
toEnum 1024 = ObjCPropertyAttr_strong
toEnum 2048 = ObjCPropertyAttr_unsafe_unretained
toEnum unmatched = error ("ObjCPropertyAttrKind.toEnum: Cannot match " ++ show unmatched)
instance BitFlags ObjCPropertyAttrKind where
toBit ObjCPropertyAttr_noattr = 0x0
toBit ObjCPropertyAttr_readonly = 0x1
toBit ObjCPropertyAttr_getter = 0x2
toBit ObjCPropertyAttr_assign = 0x4
toBit ObjCPropertyAttr_readwrite = 0x8
toBit ObjCPropertyAttr_retain = 0x10
toBit ObjCPropertyAttr_copy = 0x20
toBit ObjCPropertyAttr_nonatomic = 0x40
toBit ObjCPropertyAttr_setter = 0x80
toBit ObjCPropertyAttr_atomic = 0x100
toBit ObjCPropertyAttr_weak = 0x200
toBit ObjCPropertyAttr_strong = 0x400
toBit ObjCPropertyAttr_unsafe_unretained = 0x800
clang_Cursor_getObjCPropertyAttributes :: (Cursor a) -> (Int) -> IO ((CUInt))
clang_Cursor_getObjCPropertyAttributes a1 a2 =
withVoided a1 $ \a1' ->
let {a2' = fromIntegral a2} in
clang_Cursor_getObjCPropertyAttributes'_ a1' a2' >>= \res ->
let {res' = fromIntegral res} in
return (res')
cursor_getObjCPropertyAttributes :: Cursor s -> IO Int
cursor_getObjCPropertyAttributes c = clang_Cursor_getObjCPropertyAttributes c 0 >>= return . fromIntegral
data ObjCDeclQualifierKind = ObjCDeclQualifier_None
| ObjCDeclQualifier_In
| ObjCDeclQualifier_Inout
| ObjCDeclQualifier_Out
| ObjCDeclQualifier_Bycopy
| ObjCDeclQualifier_Byref
| ObjCDeclQualifier_Oneway
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum ObjCDeclQualifierKind where
succ ObjCDeclQualifier_None = ObjCDeclQualifier_In
succ ObjCDeclQualifier_In = ObjCDeclQualifier_Inout
succ ObjCDeclQualifier_Inout = ObjCDeclQualifier_Out
succ ObjCDeclQualifier_Out = ObjCDeclQualifier_Bycopy
succ ObjCDeclQualifier_Bycopy = ObjCDeclQualifier_Byref
succ ObjCDeclQualifier_Byref = ObjCDeclQualifier_Oneway
succ ObjCDeclQualifier_Oneway = error "ObjCDeclQualifierKind.succ: ObjCDeclQualifier_Oneway has no successor"
pred ObjCDeclQualifier_In = ObjCDeclQualifier_None
pred ObjCDeclQualifier_Inout = ObjCDeclQualifier_In
pred ObjCDeclQualifier_Out = ObjCDeclQualifier_Inout
pred ObjCDeclQualifier_Bycopy = ObjCDeclQualifier_Out
pred ObjCDeclQualifier_Byref = ObjCDeclQualifier_Bycopy
pred ObjCDeclQualifier_Oneway = ObjCDeclQualifier_Byref
pred ObjCDeclQualifier_None = error "ObjCDeclQualifierKind.pred: ObjCDeclQualifier_None has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from ObjCDeclQualifier_Oneway
fromEnum ObjCDeclQualifier_None = 0
fromEnum ObjCDeclQualifier_In = 1
fromEnum ObjCDeclQualifier_Inout = 2
fromEnum ObjCDeclQualifier_Out = 4
fromEnum ObjCDeclQualifier_Bycopy = 8
fromEnum ObjCDeclQualifier_Byref = 16
fromEnum ObjCDeclQualifier_Oneway = 32
toEnum 0 = ObjCDeclQualifier_None
toEnum 1 = ObjCDeclQualifier_In
toEnum 2 = ObjCDeclQualifier_Inout
toEnum 4 = ObjCDeclQualifier_Out
toEnum 8 = ObjCDeclQualifier_Bycopy
toEnum 16 = ObjCDeclQualifier_Byref
toEnum 32 = ObjCDeclQualifier_Oneway
toEnum unmatched = error ("ObjCDeclQualifierKind.toEnum: Cannot match " ++ show unmatched)
instance BitFlags ObjCDeclQualifierKind where
toBit ObjCDeclQualifier_None = 0x0
toBit ObjCDeclQualifier_In = 0x1
toBit ObjCDeclQualifier_Inout = 0x2
toBit ObjCDeclQualifier_Out = 0x4
toBit ObjCDeclQualifier_Bycopy = 0x8
toBit ObjCDeclQualifier_Byref = 0x10
toBit ObjCDeclQualifier_Oneway = 0x20
clang_Cursor_getObjCDeclQualifiers :: (Cursor a) -> IO ((CUInt))
clang_Cursor_getObjCDeclQualifiers a1 =
withVoided a1 $ \a1' ->
clang_Cursor_getObjCDeclQualifiers'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
cursor_getObjCDeclQualifiers :: Cursor s -> IO Int
cursor_getObjCDeclQualifiers c =
clang_Cursor_getObjCDeclQualifiers c >>= return . fromIntegral
clang_Cursor_isObjCOptional :: (Cursor a) -> IO ((Bool))
clang_Cursor_isObjCOptional a1 =
withVoided a1 $ \a1' ->
clang_Cursor_isObjCOptional'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
cursor_isObjCOptional :: Cursor s -> IO Bool
cursor_isObjCOptional c = clang_Cursor_isObjCOptional c
clang_Cursor_isVariadic :: (Cursor a) -> IO ((Bool))
clang_Cursor_isVariadic a1 =
withVoided a1 $ \a1' ->
clang_Cursor_isVariadic'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
cursor_isVariadic :: Cursor s -> IO Bool
cursor_isVariadic c = clang_Cursor_isVariadic c
clang_Cursor_getCommentRange :: (Cursor a) -> IO ((Ptr (SourceRange s)))
clang_Cursor_getCommentRange a1 =
withVoided a1 $ \a1' ->
clang_Cursor_getCommentRange'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
cursor_getCommentRange :: Proxy s -> Cursor s' -> IO (SourceRange s)
cursor_getCommentRange _ c = clang_Cursor_getCommentRange c >>= peek
clang_Cursor_getRawCommentText :: (Cursor a) -> IO ((Ptr (ClangString ())))
clang_Cursor_getRawCommentText a1 =
withVoided a1 $ \a1' ->
clang_Cursor_getRawCommentText'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_Cursor_getRawCommentText :: Cursor s -> IO (ClangString ())
unsafe_Cursor_getRawCommentText c =
clang_Cursor_getRawCommentText c >>= peek
cursor_getRawCommentText :: ClangBase m => Cursor s' -> ClangT s m (ClangString s)
cursor_getRawCommentText = registerClangString . unsafe_Cursor_getRawCommentText
clang_Cursor_getBriefCommentText :: (Cursor a) -> IO ((Ptr (ClangString ())))
clang_Cursor_getBriefCommentText a1 =
withVoided a1 $ \a1' ->
clang_Cursor_getBriefCommentText'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_Cursor_getBriefCommentText :: Cursor s -> IO (ClangString ())
unsafe_Cursor_getBriefCommentText c =
clang_Cursor_getBriefCommentText c >>= peek
cursor_getBriefCommentText :: ClangBase m => Cursor s' -> ClangT s m (ClangString s)
cursor_getBriefCommentText = registerClangString . unsafe_Cursor_getBriefCommentText
clang_Cursor_getParsedComment :: (Cursor a) -> IO ((Ptr (Comment s)))
clang_Cursor_getParsedComment a1 =
withVoided a1 $ \a1' ->
clang_Cursor_getParsedComment'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
cursor_getParsedComment :: Proxy s -> Cursor s' -> IO (Comment s)
cursor_getParsedComment _ c =
clang_Cursor_getParsedComment c >>= peek
newtype Module s = Module { unModule :: Ptr () }
deriving (Eq, Ord, Typeable)
instance ClangValue Module
maybeModule :: Module s' -> Maybe (Module s)
maybeModule (Module p) | p == nullPtr = Nothing
maybeModule f = Just (unsafeCoerce f)
unMaybeModule :: Maybe (Module s') -> Module s
unMaybeModule (Just f) = unsafeCoerce f
unMaybeModule Nothing = Module nullPtr
clang_Cursor_getModule :: (Cursor a) -> IO ((Ptr ()))
clang_Cursor_getModule a1 =
withVoided a1 $ \a1' ->
clang_Cursor_getModule'_ a1' >>= \res ->
let {res' = id res} in
return (res')
cursor_getModule :: Proxy s -> Cursor s' -> IO (Module s)
cursor_getModule _ c =
clang_Cursor_getModule c >>= return . Module
clang_Module_getASTFile :: (Ptr ()) -> IO ((Ptr ()))
clang_Module_getASTFile a1 =
let {a1' = id a1} in
clang_Module_getASTFile'_ a1' >>= \res ->
let {res' = id res} in
return (res')
module_getASTFile :: Proxy s -> Module s' -> IO (File s)
module_getASTFile _ m = clang_Module_getASTFile (unModule m) >>= return . File
clang_Module_getParent :: (Ptr ()) -> IO ((Ptr ()))
clang_Module_getParent a1 =
let {a1' = id a1} in
clang_Module_getParent'_ a1' >>= \res ->
let {res' = id res} in
return (res')
module_getParent :: Proxy s -> Module s' -> IO (Maybe (Module s))
module_getParent _ m = clang_Module_getParent (unModule m) >>= return . maybeModule . Module
clang_Module_getName :: (Ptr ()) -> IO ((Ptr (ClangString ())))
clang_Module_getName a1 =
let {a1' = id a1} in
clang_Module_getName'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_Module_getName :: Module s -> IO (ClangString ())
unsafe_Module_getName m = clang_Module_getName (unModule m) >>= peek
module_getName :: ClangBase m => Module s' -> ClangT s m (ClangString s)
module_getName = registerClangString . unsafe_Module_getName
clang_Module_getFullName :: (Ptr ()) -> IO ((Ptr (ClangString ())))
clang_Module_getFullName a1 =
let {a1' = id a1} in
clang_Module_getFullName'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_Module_getFullName :: Module s -> IO (ClangString ())
unsafe_Module_getFullName m = clang_Module_getFullName (unModule m) >>= peek
module_getFullName :: ClangBase m => Module s' -> ClangT s m (ClangString s)
module_getFullName = registerClangString . unsafe_Module_getFullName
clang_Module_getNumTopLevelHeaders :: (Ptr ()) -> (Ptr ()) -> IO ((Int))
clang_Module_getNumTopLevelHeaders a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
clang_Module_getNumTopLevelHeaders'_ a1' a2' >>= \res ->
let {res' = fromIntegral res} in
return (res')
module_getNumTopLevelHeaders :: TranslationUnit s -> Module s' -> IO Int
module_getNumTopLevelHeaders t m = clang_Module_getNumTopLevelHeaders (unTranslationUnit t) (unModule m)
clang_Module_getTopLevelHeader :: (Ptr ()) -> (Ptr ()) -> (Int) -> IO ((Ptr ()))
clang_Module_getTopLevelHeader a1 a2 a3 =
let {a1' = id a1} in
let {a2' = id a2} in
let {a3' = fromIntegral a3} in
clang_Module_getTopLevelHeader'_ a1' a2' a3' >>= \res ->
let {res' = id res} in
return (res')
module_getTopLevelHeader :: Proxy s -> TranslationUnit s' -> Module s'' -> Int -> IO (File s)
module_getTopLevelHeader _ t m i = clang_Module_getTopLevelHeader (unTranslationUnit t) (unModule m) i >>= return . File
clang_CXXMethod_isPureVirtual :: (Cursor a) -> IO ((Bool))
clang_CXXMethod_isPureVirtual a1 =
withVoided a1 $ \a1' ->
clang_CXXMethod_isPureVirtual'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
cXXMethod_isPureVirtual :: Cursor s -> IO Bool
cXXMethod_isPureVirtual c = clang_Cursor_isBitField c
clang_CXXMethod_isStatic :: (Cursor a) -> IO ((Bool))
clang_CXXMethod_isStatic a1 =
withVoided a1 $ \a1' ->
clang_CXXMethod_isStatic'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
cXXMethod_isStatic :: Cursor s -> IO Bool
cXXMethod_isStatic c = clang_Cursor_isBitField c
clang_CXXMethod_isVirtual :: (Cursor a) -> IO ((Bool))
clang_CXXMethod_isVirtual a1 =
withVoided a1 $ \a1' ->
clang_CXXMethod_isVirtual'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
cXXMethod_isVirtual :: Cursor s -> IO Bool
cXXMethod_isVirtual c = clang_Cursor_isBitField c
clang_getTemplateCursorKind :: (Cursor a) -> IO ((Int))
clang_getTemplateCursorKind a1 =
withVoided a1 $ \a1' ->
clang_getTemplateCursorKind'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getTemplateCursorKind :: Cursor s -> IO CursorKind
getTemplateCursorKind c =
clang_getTemplateCursorKind c >>= return . toEnum
clang_getSpecializedCursorTemplate :: (Cursor a) -> IO ((Ptr (Cursor s)))
clang_getSpecializedCursorTemplate a1 =
withVoided a1 $ \a1' ->
clang_getSpecializedCursorTemplate'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
getSpecializedCursorTemplate :: Proxy s -> Cursor s' -> IO (Cursor s)
getSpecializedCursorTemplate _ c =
clang_getSpecializedCursorTemplate c >>= peek
clang_getCursorReferenceNameRange :: (Cursor a) -> (Int) -> (Int) -> IO ((Ptr (SourceRange s)))
clang_getCursorReferenceNameRange a1 a2 a3 =
withVoided a1 $ \a1' ->
let {a2' = fromIntegral a2} in
let {a3' = fromIntegral a3} in
clang_getCursorReferenceNameRange'_ a1' a2' a3' >>= \res ->
let {res' = castPtr res} in
return (res')
getCursorReferenceNameRange :: Proxy s -> Cursor s' -> Int -> Int -> IO (SourceRange s)
getCursorReferenceNameRange _ c fs idx = clang_getCursorReferenceNameRange c fs idx >>= peek
data NameRefFlags = NameRange_WantQualifier
| NameRange_WantTemplateArgs
| NameRange_WantSinglePiece
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum NameRefFlags where
succ NameRange_WantQualifier = NameRange_WantTemplateArgs
succ NameRange_WantTemplateArgs = NameRange_WantSinglePiece
succ NameRange_WantSinglePiece = error "NameRefFlags.succ: NameRange_WantSinglePiece has no successor"
pred NameRange_WantTemplateArgs = NameRange_WantQualifier
pred NameRange_WantSinglePiece = NameRange_WantTemplateArgs
pred NameRange_WantQualifier = error "NameRefFlags.pred: NameRange_WantQualifier has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from NameRange_WantSinglePiece
fromEnum NameRange_WantQualifier = 1
fromEnum NameRange_WantTemplateArgs = 2
fromEnum NameRange_WantSinglePiece = 4
toEnum 1 = NameRange_WantQualifier
toEnum 2 = NameRange_WantTemplateArgs
toEnum 4 = NameRange_WantSinglePiece
toEnum unmatched = error ("NameRefFlags.toEnum: Cannot match " ++ show unmatched)
instance BitFlags NameRefFlags where
toBit NameRange_WantQualifier = 0x01
toBit NameRange_WantTemplateArgs = 0x02
toBit NameRange_WantSinglePiece = 0x04
data CommentKind = NullComment
| TextComment
| InlineCommandComment
| HTMLStartTagComment
| HTMLEndTagComment
| ParagraphComment
| BlockCommandComment
| ParamCommandComment
| TParamCommandComment
| VerbatimBlockCommandComment
| VerbatimBlockLineComment
| VerbatimLineComment
| FullComment
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum CommentKind where
succ NullComment = TextComment
succ TextComment = InlineCommandComment
succ InlineCommandComment = HTMLStartTagComment
succ HTMLStartTagComment = HTMLEndTagComment
succ HTMLEndTagComment = ParagraphComment
succ ParagraphComment = BlockCommandComment
succ BlockCommandComment = ParamCommandComment
succ ParamCommandComment = TParamCommandComment
succ TParamCommandComment = VerbatimBlockCommandComment
succ VerbatimBlockCommandComment = VerbatimBlockLineComment
succ VerbatimBlockLineComment = VerbatimLineComment
succ VerbatimLineComment = FullComment
succ FullComment = error "CommentKind.succ: FullComment has no successor"
pred TextComment = NullComment
pred InlineCommandComment = TextComment
pred HTMLStartTagComment = InlineCommandComment
pred HTMLEndTagComment = HTMLStartTagComment
pred ParagraphComment = HTMLEndTagComment
pred BlockCommandComment = ParagraphComment
pred ParamCommandComment = BlockCommandComment
pred TParamCommandComment = ParamCommandComment
pred VerbatimBlockCommandComment = TParamCommandComment
pred VerbatimBlockLineComment = VerbatimBlockCommandComment
pred VerbatimLineComment = VerbatimBlockLineComment
pred FullComment = VerbatimLineComment
pred NullComment = error "CommentKind.pred: NullComment has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from FullComment
fromEnum NullComment = 0
fromEnum TextComment = 1
fromEnum InlineCommandComment = 2
fromEnum HTMLStartTagComment = 3
fromEnum HTMLEndTagComment = 4
fromEnum ParagraphComment = 5
fromEnum BlockCommandComment = 6
fromEnum ParamCommandComment = 7
fromEnum TParamCommandComment = 8
fromEnum VerbatimBlockCommandComment = 9
fromEnum VerbatimBlockLineComment = 10
fromEnum VerbatimLineComment = 11
fromEnum FullComment = 12
toEnum 0 = NullComment
toEnum 1 = TextComment
toEnum 2 = InlineCommandComment
toEnum 3 = HTMLStartTagComment
toEnum 4 = HTMLEndTagComment
toEnum 5 = ParagraphComment
toEnum 6 = BlockCommandComment
toEnum 7 = ParamCommandComment
toEnum 8 = TParamCommandComment
toEnum 9 = VerbatimBlockCommandComment
toEnum 10 = VerbatimBlockLineComment
toEnum 11 = VerbatimLineComment
toEnum 12 = FullComment
toEnum unmatched = error ("CommentKind.toEnum: Cannot match " ++ show unmatched)
data InlineCommandRenderStyle = NormalInlineCommandRenderStyle
| BoldInlineCommandRenderStyle
| MonospacedInlineCommandRenderStyle
| EmphasizedInlineCommandRenderStyle
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum InlineCommandRenderStyle where
succ NormalInlineCommandRenderStyle = BoldInlineCommandRenderStyle
succ BoldInlineCommandRenderStyle = MonospacedInlineCommandRenderStyle
succ MonospacedInlineCommandRenderStyle = EmphasizedInlineCommandRenderStyle
succ EmphasizedInlineCommandRenderStyle = error "InlineCommandRenderStyle.succ: EmphasizedInlineCommandRenderStyle has no successor"
pred BoldInlineCommandRenderStyle = NormalInlineCommandRenderStyle
pred MonospacedInlineCommandRenderStyle = BoldInlineCommandRenderStyle
pred EmphasizedInlineCommandRenderStyle = MonospacedInlineCommandRenderStyle
pred NormalInlineCommandRenderStyle = error "InlineCommandRenderStyle.pred: NormalInlineCommandRenderStyle has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from EmphasizedInlineCommandRenderStyle
fromEnum NormalInlineCommandRenderStyle = 0
fromEnum BoldInlineCommandRenderStyle = 1
fromEnum MonospacedInlineCommandRenderStyle = 2
fromEnum EmphasizedInlineCommandRenderStyle = 3
toEnum 0 = NormalInlineCommandRenderStyle
toEnum 1 = BoldInlineCommandRenderStyle
toEnum 2 = MonospacedInlineCommandRenderStyle
toEnum 3 = EmphasizedInlineCommandRenderStyle
toEnum unmatched = error ("InlineCommandRenderStyle.toEnum: Cannot match " ++ show unmatched)
data ParamPassDirectionKind = InParamPassDirection
| OutParamPassDirection
| InOutParamPassDirection
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum ParamPassDirectionKind where
succ InParamPassDirection = OutParamPassDirection
succ OutParamPassDirection = InOutParamPassDirection
succ InOutParamPassDirection = error "ParamPassDirectionKind.succ: InOutParamPassDirection has no successor"
pred OutParamPassDirection = InParamPassDirection
pred InOutParamPassDirection = OutParamPassDirection
pred InParamPassDirection = error "ParamPassDirectionKind.pred: InParamPassDirection has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from InOutParamPassDirection
fromEnum InParamPassDirection = 0
fromEnum OutParamPassDirection = 1
fromEnum InOutParamPassDirection = 2
toEnum 0 = InParamPassDirection
toEnum 1 = OutParamPassDirection
toEnum 2 = InOutParamPassDirection
toEnum unmatched = error ("ParamPassDirectionKind.toEnum: Cannot match " ++ show unmatched)
clang_Comment_getKind :: (Comment a) -> IO ((Int))
clang_Comment_getKind a1 =
withVoided a1 $ \a1' ->
clang_Comment_getKind'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
comment_getKind :: Comment s -> IO CommentKind
comment_getKind c =
clang_Comment_getKind c >>= return . toEnum
clang_Comment_getNumChildren :: (Comment a) -> IO ((Int))
clang_Comment_getNumChildren a1 =
withVoided a1 $ \a1' ->
clang_Comment_getNumChildren'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
comment_getNumChildren :: Comment s -> IO Int
comment_getNumChildren c =
clang_Comment_getNumChildren c
clang_Comment_getChild :: (Comment a) -> (Int) -> IO ((Ptr (Comment s)))
clang_Comment_getChild a1 a2 =
withVoided a1 $ \a1' ->
let {a2' = fromIntegral a2} in
clang_Comment_getChild'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
comment_getChild :: Proxy s -> Comment s' -> Int -> IO (Comment s)
comment_getChild _ c i = clang_Comment_getChild c i >>= peek
clang_Comment_isWhitespace :: (Comment a) -> IO ((Bool))
clang_Comment_isWhitespace a1 =
withVoided a1 $ \a1' ->
clang_Comment_isWhitespace'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
comment_isWhitespace :: Comment s -> IO Bool
comment_isWhitespace c = clang_Comment_isWhitespace c
clang_InlineContentComment_hasTrailingNewline :: (Comment a) -> IO ((Bool))
clang_InlineContentComment_hasTrailingNewline a1 =
withVoided a1 $ \a1' ->
clang_InlineContentComment_hasTrailingNewline'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
inlineContentComment_hasTrailingNewline :: Comment s -> IO Bool
inlineContentComment_hasTrailingNewline c = clang_InlineContentComment_hasTrailingNewline c
clang_TextComment_getText :: (Comment a) -> IO ((Ptr (ClangString ())))
clang_TextComment_getText a1 =
withVoided a1 $ \a1' ->
clang_TextComment_getText'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_TextComment_getText :: Comment s -> IO (ClangString ())
unsafe_TextComment_getText c =
clang_TextComment_getText c >>= peek
textComment_getText :: ClangBase m => Comment s' -> ClangT s m (ClangString s)
textComment_getText = registerClangString . unsafe_TextComment_getText
clang_InlineCommandComment_getCommandName :: (Comment a) -> IO ((Ptr (ClangString ())))
clang_InlineCommandComment_getCommandName a1 =
withVoided a1 $ \a1' ->
clang_InlineCommandComment_getCommandName'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_InlineCommandComment_getCommandName :: Comment s -> IO (ClangString ())
unsafe_InlineCommandComment_getCommandName c =
clang_InlineCommandComment_getCommandName c >>= peek
inlineCommandComment_getCommandName :: ClangBase m => Comment s' -> ClangT s m (ClangString s)
inlineCommandComment_getCommandName = registerClangString . unsafe_InlineCommandComment_getCommandName
clang_InlineCommandComment_getRenderKind :: (Comment a) -> IO ((Int))
clang_InlineCommandComment_getRenderKind a1 =
withVoided a1 $ \a1' ->
clang_InlineCommandComment_getRenderKind'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
inlineCommandComment_getRenderKind :: Comment s -> IO InlineCommandRenderStyle
inlineCommandComment_getRenderKind c =
clang_InlineCommandComment_getRenderKind c >>= return . toEnum
clang_InlineCommandComment_getNumArgs :: (Comment a) -> IO ((Int))
clang_InlineCommandComment_getNumArgs a1 =
withVoided a1 $ \a1' ->
clang_InlineCommandComment_getNumArgs'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
inlineCommandComment_getNumArgs :: Comment s -> IO Int
inlineCommandComment_getNumArgs c =
clang_InlineCommandComment_getNumArgs c
clang_InlineCommandComment_getArgText :: (Comment a) -> (Int) -> IO ((Ptr (ClangString ())))
clang_InlineCommandComment_getArgText a1 a2 =
withVoided a1 $ \a1' ->
let {a2' = fromIntegral a2} in
clang_InlineCommandComment_getArgText'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_InlineCommandComment_getArgText :: Comment s -> Int -> IO (ClangString ())
unsafe_InlineCommandComment_getArgText c idx =
clang_InlineCommandComment_getArgText c idx >>= peek
inlineCommandComment_getArgText :: ClangBase m => Comment s' -> Int -> ClangT s m (ClangString s)
inlineCommandComment_getArgText = (registerClangString .) . unsafe_InlineCommandComment_getArgText
clang_HTMLTagComment_getTagName :: (Comment a) -> IO ((Ptr (ClangString ())))
clang_HTMLTagComment_getTagName a1 =
withVoided a1 $ \a1' ->
clang_HTMLTagComment_getTagName'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_HTMLTagComment_getTagName :: Comment s -> IO (ClangString ())
unsafe_HTMLTagComment_getTagName c =
clang_HTMLTagComment_getTagName c >>= peek
hTMLTagComment_getTagName :: ClangBase m => Comment s' -> ClangT s m (ClangString s)
hTMLTagComment_getTagName = registerClangString . unsafe_HTMLTagComment_getTagName
clang_HTMLStartTagComment_isSelfClosing :: (Comment a) -> IO ((Bool))
clang_HTMLStartTagComment_isSelfClosing a1 =
withVoided a1 $ \a1' ->
clang_HTMLStartTagComment_isSelfClosing'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
hTMLStartTagComment_isSelfClosing :: Comment s -> IO Bool
hTMLStartTagComment_isSelfClosing c = clang_HTMLStartTagComment_isSelfClosing c
clang_HTMLStartTag_getNumAttrs :: (Comment a) -> IO ((Int))
clang_HTMLStartTag_getNumAttrs a1 =
withVoided a1 $ \a1' ->
clang_HTMLStartTag_getNumAttrs'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
hTMLStartTag_getNumAttrs :: Comment s -> IO Int
hTMLStartTag_getNumAttrs c =
clang_HTMLStartTag_getNumAttrs c
clang_HTMLStartTag_getAttrName :: (Comment a) -> (Int) -> IO ((Ptr (ClangString ())))
clang_HTMLStartTag_getAttrName a1 a2 =
withVoided a1 $ \a1' ->
let {a2' = fromIntegral a2} in
clang_HTMLStartTag_getAttrName'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_HTMLStartTag_getAttrName :: Comment s -> Int -> IO (ClangString ())
unsafe_HTMLStartTag_getAttrName c idx =
clang_HTMLStartTag_getAttrName c idx >>= peek
hTMLStartTag_getAttrName :: ClangBase m => Comment s' -> Int -> ClangT s m (ClangString s)
hTMLStartTag_getAttrName = (registerClangString .) . unsafe_HTMLStartTag_getAttrName
clang_HTMLStartTag_getAttrValue :: (Comment a) -> (Int) -> IO ((Ptr (ClangString ())))
clang_HTMLStartTag_getAttrValue a1 a2 =
withVoided a1 $ \a1' ->
let {a2' = fromIntegral a2} in
clang_HTMLStartTag_getAttrValue'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_HTMLStartTag_getAttrValue :: Comment s -> Int -> IO (ClangString ())
unsafe_HTMLStartTag_getAttrValue c idx =
clang_HTMLStartTag_getAttrValue c idx >>= peek
hTMLStartTag_getAttrValue :: ClangBase m => Comment s' -> Int -> ClangT s m (ClangString s)
hTMLStartTag_getAttrValue = (registerClangString .) . unsafe_HTMLStartTag_getAttrValue
clang_BlockCommandComment_getCommandName :: (Comment a) -> IO ((Ptr (ClangString ())))
clang_BlockCommandComment_getCommandName a1 =
withVoided a1 $ \a1' ->
clang_BlockCommandComment_getCommandName'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_BlockCommandComment_getCommandName :: Comment s -> IO (ClangString ())
unsafe_BlockCommandComment_getCommandName c =
clang_BlockCommandComment_getCommandName c >>= peek
blockCommandComment_getCommandName :: ClangBase m => Comment s' -> ClangT s m (ClangString s)
blockCommandComment_getCommandName = registerClangString . unsafe_BlockCommandComment_getCommandName
clang_BlockCommandComment_getNumArgs :: (Comment a) -> IO ((Int))
clang_BlockCommandComment_getNumArgs a1 =
withVoided a1 $ \a1' ->
clang_BlockCommandComment_getNumArgs'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
blockCommandComment_getNumArgs :: Comment s -> IO Int
blockCommandComment_getNumArgs c =
clang_BlockCommandComment_getNumArgs c
clang_BlockCommandComment_getArgText :: (Comment a) -> (Int) -> IO ((Ptr (ClangString ())))
clang_BlockCommandComment_getArgText a1 a2 =
withVoided a1 $ \a1' ->
let {a2' = fromIntegral a2} in
clang_BlockCommandComment_getArgText'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_BlockCommandComment_getArgText :: Comment s -> Int -> IO (ClangString ())
unsafe_BlockCommandComment_getArgText c idx =
clang_BlockCommandComment_getArgText c idx >>= peek
blockCommandComment_getArgText :: ClangBase m => Comment s' -> Int -> ClangT s m (ClangString s)
blockCommandComment_getArgText = (registerClangString .) . unsafe_BlockCommandComment_getArgText
clang_BlockCommandComment_getParagraph :: (Comment a) -> IO ((Ptr (Comment s)))
clang_BlockCommandComment_getParagraph a1 =
withVoided a1 $ \a1' ->
clang_BlockCommandComment_getParagraph'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
blockCommandComment_getParagraph :: Proxy s -> Comment s' -> IO (Comment s)
blockCommandComment_getParagraph _ c =
clang_BlockCommandComment_getParagraph c >>= peek
clang_ParamCommandComment_getParamName :: (Comment a) -> IO ((Ptr (ClangString ())))
clang_ParamCommandComment_getParamName a1 =
withVoided a1 $ \a1' ->
clang_ParamCommandComment_getParamName'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_ParamCommandComment_getParamName :: Comment s -> IO (ClangString ())
unsafe_ParamCommandComment_getParamName c =
clang_ParamCommandComment_getParamName c >>= peek
paramCommandComment_getParamName :: ClangBase m => Comment s' -> ClangT s m (ClangString s)
paramCommandComment_getParamName = registerClangString . unsafe_ParamCommandComment_getParamName
clang_ParamCommandComment_isParamIndexValid :: (Comment a) -> IO ((Bool))
clang_ParamCommandComment_isParamIndexValid a1 =
withVoided a1 $ \a1' ->
clang_ParamCommandComment_isParamIndexValid'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
paramCommandComment_isParamIndexValid :: Comment s -> IO Bool
paramCommandComment_isParamIndexValid c =
clang_ParamCommandComment_isParamIndexValid c
clang_ParamCommandComment_getParamIndex :: (Comment a) -> IO ((Int))
clang_ParamCommandComment_getParamIndex a1 =
withVoided a1 $ \a1' ->
clang_ParamCommandComment_getParamIndex'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
paramCommandComment_getParamIndex :: Comment s -> IO Int
paramCommandComment_getParamIndex c =
clang_ParamCommandComment_getParamIndex c
clang_ParamCommandComment_isDirectionExplicit :: (Comment a) -> IO ((Bool))
clang_ParamCommandComment_isDirectionExplicit a1 =
withVoided a1 $ \a1' ->
clang_ParamCommandComment_isDirectionExplicit'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
paramCommandComment_isDirectionExplicit :: Comment s -> IO Bool
paramCommandComment_isDirectionExplicit c =
clang_ParamCommandComment_isDirectionExplicit c
clang_ParamCommandComment_getDirection :: (Comment a) -> IO ((Int))
clang_ParamCommandComment_getDirection a1 =
withVoided a1 $ \a1' ->
clang_ParamCommandComment_getDirection'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
paramCommandComment_getDirection :: Comment s -> IO ParamPassDirectionKind
paramCommandComment_getDirection c =
clang_ParamCommandComment_getDirection c >>= return . toEnum
clang_TParamCommandComment_getParamName :: (Comment a) -> IO ((Ptr (ClangString ())))
clang_TParamCommandComment_getParamName a1 =
withVoided a1 $ \a1' ->
clang_TParamCommandComment_getParamName'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_TParamCommandComment_getParamName :: Comment s -> IO (ClangString ())
unsafe_TParamCommandComment_getParamName c =
clang_TParamCommandComment_getParamName c >>= peek
tParamCommandComment_getParamName :: ClangBase m => Comment s' -> ClangT s m (ClangString s)
tParamCommandComment_getParamName = registerClangString . unsafe_TParamCommandComment_getParamName
clang_TParamCommandComment_isParamPositionValid :: (Comment a) -> IO ((Bool))
clang_TParamCommandComment_isParamPositionValid a1 =
withVoided a1 $ \a1' ->
clang_TParamCommandComment_isParamPositionValid'_ a1' >>= \res ->
let {res' = toBool res} in
return (res')
tParamCommandComment_isParamPositionValid :: Comment s -> IO Bool
tParamCommandComment_isParamPositionValid c =
clang_TParamCommandComment_isParamPositionValid c
clang_TParamCommandComment_getDepth :: (Comment a) -> IO ((Int))
clang_TParamCommandComment_getDepth a1 =
withVoided a1 $ \a1' ->
clang_TParamCommandComment_getDepth'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
tParamCommandComment_getDepth :: Comment s -> IO Int
tParamCommandComment_getDepth c =
clang_TParamCommandComment_getDepth c
clang_TParamCommandComment_getIndex :: (Comment a) -> (Int) -> IO ((Int))
clang_TParamCommandComment_getIndex a1 a2 =
withVoided a1 $ \a1' ->
let {a2' = fromIntegral a2} in
clang_TParamCommandComment_getIndex'_ a1' a2' >>= \res ->
let {res' = fromIntegral res} in
return (res')
tParamCommandComment_getIndex :: Comment s -> Int -> IO Int
tParamCommandComment_getIndex c idx =
clang_TParamCommandComment_getIndex c idx
clang_VerbatimBlockLineComment_getText :: (Comment a) -> IO ((Ptr (ClangString ())))
clang_VerbatimBlockLineComment_getText a1 =
withVoided a1 $ \a1' ->
clang_VerbatimBlockLineComment_getText'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_VerbatimBlockLineComment_getText :: Comment s -> IO (ClangString ())
unsafe_VerbatimBlockLineComment_getText c =
clang_VerbatimBlockLineComment_getText c >>= peek
verbatimBlockLineComment_getText :: ClangBase m => Comment s' -> ClangT s m (ClangString s)
verbatimBlockLineComment_getText = registerClangString . unsafe_VerbatimBlockLineComment_getText
clang_VerbatimLineComment_getText :: (Comment a) -> IO ((Ptr (ClangString ())))
clang_VerbatimLineComment_getText a1 =
withVoided a1 $ \a1' ->
clang_VerbatimLineComment_getText'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_VerbatimLineComment_getText :: Comment s -> IO (ClangString ())
unsafe_VerbatimLineComment_getText c =
clang_VerbatimLineComment_getText c >>= peek
verbatimLineComment_getText :: ClangBase m => Comment s' -> ClangT s m (ClangString s)
verbatimLineComment_getText = registerClangString . unsafe_VerbatimLineComment_getText
clang_HTMLTagComment_getAsString :: (Comment a) -> IO ((Ptr (ClangString ())))
clang_HTMLTagComment_getAsString a1 =
withVoided a1 $ \a1' ->
clang_HTMLTagComment_getAsString'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_HTMLTagComment_getAsString :: Comment s -> IO (ClangString ())
unsafe_HTMLTagComment_getAsString c =
clang_HTMLTagComment_getAsString c >>= peek
hTMLTagComment_getAsString :: ClangBase m => Comment s' -> ClangT s m (ClangString s)
hTMLTagComment_getAsString = registerClangString . unsafe_HTMLTagComment_getAsString
clang_FullComment_getAsHTML :: (Comment a) -> IO ((Ptr (ClangString ())))
clang_FullComment_getAsHTML a1 =
withVoided a1 $ \a1' ->
clang_FullComment_getAsHTML'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_FullComment_getAsHTML :: Comment s -> IO (ClangString ())
unsafe_FullComment_getAsHTML c =
clang_FullComment_getAsHTML c >>= peek
fullComment_getAsHTML :: ClangBase m => Comment s' -> ClangT s m (ClangString s)
fullComment_getAsHTML = registerClangString . unsafe_FullComment_getAsHTML
clang_FullComment_getAsXML :: (Comment a) -> IO ((Ptr (ClangString ())))
clang_FullComment_getAsXML a1 =
withVoided a1 $ \a1' ->
clang_FullComment_getAsXML'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_FullComment_getAsXML :: Comment s -> IO (ClangString ())
unsafe_FullComment_getAsXML c =
clang_FullComment_getAsXML c >>= peek
fullComment_getAsXML :: ClangBase m => Comment s' -> ClangT s m (ClangString s)
fullComment_getAsXML = registerClangString . unsafe_FullComment_getAsXML
data TokenKind = PunctuationToken
| KeywordToken
| IdentifierToken
| LiteralToken
| CommentToken
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum TokenKind where
succ PunctuationToken = KeywordToken
succ KeywordToken = IdentifierToken
succ IdentifierToken = LiteralToken
succ LiteralToken = CommentToken
succ CommentToken = error "TokenKind.succ: CommentToken has no successor"
pred KeywordToken = PunctuationToken
pred IdentifierToken = KeywordToken
pred LiteralToken = IdentifierToken
pred CommentToken = LiteralToken
pred PunctuationToken = error "TokenKind.pred: PunctuationToken has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from CommentToken
fromEnum PunctuationToken = 0
fromEnum KeywordToken = 1
fromEnum IdentifierToken = 2
fromEnum LiteralToken = 3
fromEnum CommentToken = 4
toEnum 0 = PunctuationToken
toEnum 1 = KeywordToken
toEnum 2 = IdentifierToken
toEnum 3 = LiteralToken
toEnum 4 = CommentToken
toEnum unmatched = error ("TokenKind.toEnum: Cannot match " ++ show unmatched)
data Token s = Token !Int !Int !Int !Int !(Ptr ())
deriving (Eq, Ord, Typeable)
instance ClangValue Token
instance Storable (Token s) where
sizeOf _ = sizeOfCXToken
alignment _ = alignOfCXToken
peek p = do
int_data <- (\ptr -> do {return $ ptr `C2HSImp.plusPtr` 0 :: IO (C2HSImp.Ptr C2HSImp.CUInt)}) p >>= peekArray 4
ptr_data <- (\ptr -> do {C2HSImp.peekByteOff ptr 16 :: IO (C2HSImp.Ptr ())}) p
return $! Token (fromIntegral (int_data !! 0)) (fromIntegral (int_data !! 1)) (fromIntegral (int_data !! 2)) (fromIntegral (int_data !! 3)) ptr_data
poke p (Token i0 i1 i2 i3 ptr_data) = do
intsArray <- mallocArray 4
pokeArray intsArray (map fromIntegral [i0,i1,i2,i3])
(\ptr val -> do {C2HSImp.copyArray (ptr `C2HSImp.plusPtr` 0) (val :: (C2HSImp.Ptr C2HSImp.CUInt)) 4}) p intsArray
(\ptr val -> do {C2HSImp.pokeByteOff ptr 16 (val :: (C2HSImp.Ptr ()))}) p ptr_data
clang_getTokenKind :: (Token s) -> IO ((Int))
clang_getTokenKind a1 =
withVoided a1 $ \a1' ->
clang_getTokenKind'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getTokenKind :: Token s -> IO TokenKind
getTokenKind t =
clang_getTokenKind t >>= return . toEnum
clang_getTokenSpelling :: (Ptr ()) -> (Token s) -> IO ((Ptr (ClangString ())))
clang_getTokenSpelling a1 a2 =
let {a1' = id a1} in
withVoided a2 $ \a2' ->
clang_getTokenSpelling'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getTokenSpelling :: TranslationUnit s -> Token s' -> IO (ClangString ())
unsafe_getTokenSpelling tu t =
clang_getTokenSpelling (unTranslationUnit tu) t >>= peek
getTokenSpelling :: ClangBase m => TranslationUnit s' -> Token s'' -> ClangT s m (ClangString s)
getTokenSpelling = (registerClangString .) . unsafe_getTokenSpelling
clang_getTokenLocation :: (Ptr ()) -> (Token a) -> IO ((Ptr (SourceLocation s)))
clang_getTokenLocation a1 a2 =
let {a1' = id a1} in
withVoided a2 $ \a2' ->
clang_getTokenLocation'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
getTokenLocation :: Proxy s -> TranslationUnit t -> Token s' -> IO (SourceLocation s)
getTokenLocation _ tu t =
clang_getTokenLocation (unTranslationUnit tu) t >>= peek
clang_getTokenExtent :: (Ptr ()) -> (Token a) -> IO ((Ptr (SourceRange s)))
clang_getTokenExtent a1 a2 =
let {a1' = id a1} in
withVoided a2 $ \a2' ->
clang_getTokenExtent'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
getTokenExtent :: Proxy s -> TranslationUnit t -> Token s' -> IO (SourceRange s)
getTokenExtent _ tu t =
clang_getTokenExtent (unTranslationUnit tu) t >>= peek
type TokenList s = DVS.Vector (Token s)
instance ClangValueList Token
data UnsafeTokenList = UnsafeTokenList !(Ptr ()) !Int
foreign import ccall unsafe "FFI_stub_ffi.h clang_disposeTokens" clang_disposeTokens :: Ptr () -> Ptr () -> CUInt -> IO ()
disposeTokens :: TranslationUnit s -> TokenList s' -> IO ()
disposeTokens tu tl =
let (tPtr, n) = fromTokenList tl in
clang_disposeTokens (unTranslationUnit tu) tPtr (fromIntegral n)
registerTokenList :: ClangBase m => TranslationUnit s' -> IO UnsafeTokenList
-> ClangT s m (TokenList s)
registerTokenList tu action = do
(_, tokenList) <- clangAllocate (action >>= tokenListToVector) (disposeTokens tu)
return tokenList
tokenListToVector :: Storable a => UnsafeTokenList -> IO (DVS.Vector a)
tokenListToVector (UnsafeTokenList ts n) = do
fptr <- newForeignPtr_ (castPtr ts)
return $ DVS.unsafeFromForeignPtr fptr 0 n
fromTokenList :: TokenList s -> (Ptr (), Int)
fromTokenList ts = let (p, _, _) = DVS.unsafeToForeignPtr ts in
(castPtr $ Foreign.ForeignPtr.Unsafe.unsafeForeignPtrToPtr p, DVS.length ts)
toTokenList :: (Ptr (), Int) -> UnsafeTokenList
toTokenList (ts, n) = UnsafeTokenList ts n
clang_tokenize :: (Ptr ()) -> (SourceRange a) -> (Ptr (Ptr ())) -> IO ((CUInt))
clang_tokenize a1 a2 a3 =
let {a1' = id a1} in
withVoided a2 $ \a2' ->
let {a3' = id a3} in
alloca $ \a4' ->
clang_tokenize'_ a1' a2' a3' a4' >>
peek a4'>>= \a4'' ->
return (a4'')
unsafe_tokenize :: TranslationUnit s -> SourceRange s' -> IO UnsafeTokenList
unsafe_tokenize tu sr = do
tokensPtr <- mallocBytes (sizeOf (undefined :: (Ptr (Ptr (Token ())))))
numTokens <- clang_tokenize (unTranslationUnit tu) sr (castPtr tokensPtr)
return (toTokenList (tokensPtr, fromIntegral numTokens))
tokenize :: ClangBase m => TranslationUnit s' -> SourceRange s'' -> ClangT s m (TokenList s)
tokenize tu = registerTokenList tu . unsafe_tokenize tu
clang_annotateTokens :: (Ptr ()) -> (Ptr ()) -> (Int) -> (Ptr ()) -> IO ((()))
clang_annotateTokens a1 a2 a3 a4 =
let {a1' = id a1} in
let {a2' = id a2} in
let {a3' = fromIntegral a3} in
let {a4' = id a4} in
clang_annotateTokens'_ a1' a2' a3' a4' >>= \res ->
let {res' = id res} in
return (res')
unsafe_annotateTokens :: TranslationUnit s -> TokenList s' -> IO UnsafeCursorList
unsafe_annotateTokens tu tl =
let (tPtr, numTokens) = fromTokenList tl in
do
cPtr <- mallocBytes ((sizeOf (undefined :: (Ptr (Cursor ())))) * numTokens)
clang_annotateTokens (unTranslationUnit tu) tPtr numTokens (castPtr cPtr)
return (toCursorList (cPtr, numTokens))
annotateTokens :: ClangBase m => TranslationUnit s' -> TokenList s'' -> ClangT s m (CursorList s)
annotateTokens = (registerCursorList .) . unsafe_annotateTokens
clang_getCursorKindSpelling :: (CInt) -> IO ((Ptr (ClangString ())))
clang_getCursorKindSpelling a1 =
let {a1' = fromIntegral a1} in
clang_getCursorKindSpelling'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getCursorKindSpelling :: CursorKind -> IO (ClangString ())
unsafe_getCursorKindSpelling ck = clang_getCursorKindSpelling (fromIntegral (fromEnum ck)) >>= peek
getCursorKindSpelling :: ClangBase m => CursorKind -> ClangT s m (ClangString s)
getCursorKindSpelling = registerClangString . unsafe_getCursorKindSpelling
foreign import ccall unsafe "clang-c/Index.h clang_enableStackTraces" enableStackTraces :: IO ()
newtype CompletionString s = CompletionString (Ptr ())
deriving (Eq, Ord, Typeable)
instance ClangValue CompletionString
data CompletionResult s = CompletionResult !CursorKind !(CompletionString s)
deriving (Eq, Ord, Typeable)
instance ClangValue CompletionResult
data ChunkKind = OptionalChunkKind
| TypedTextChunkKind
| TextChunkKind
| PlaceholderChunkKind
| InformativeChunkKind
| CurrentParameterChunkKind
| LeftParenChunkKind
| RightParenChunkKind
| LeftBracketChunkKind
| RightBracketChunkKind
| LeftBraceChunkKind
| RightBraceChunkKind
| LeftAngleChunkKind
| RightAngleChunkKind
| CommaChunkKind
| ResultTypeChunkKind
| ColonChunkKind
| SemiColonChunkKind
| EqualChunkKind
| HorizontalSpaceChunkKind
| VerticalSpaceChunkKind
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum ChunkKind where
succ OptionalChunkKind = TypedTextChunkKind
succ TypedTextChunkKind = TextChunkKind
succ TextChunkKind = PlaceholderChunkKind
succ PlaceholderChunkKind = InformativeChunkKind
succ InformativeChunkKind = CurrentParameterChunkKind
succ CurrentParameterChunkKind = LeftParenChunkKind
succ LeftParenChunkKind = RightParenChunkKind
succ RightParenChunkKind = LeftBracketChunkKind
succ LeftBracketChunkKind = RightBracketChunkKind
succ RightBracketChunkKind = LeftBraceChunkKind
succ LeftBraceChunkKind = RightBraceChunkKind
succ RightBraceChunkKind = LeftAngleChunkKind
succ LeftAngleChunkKind = RightAngleChunkKind
succ RightAngleChunkKind = CommaChunkKind
succ CommaChunkKind = ResultTypeChunkKind
succ ResultTypeChunkKind = ColonChunkKind
succ ColonChunkKind = SemiColonChunkKind
succ SemiColonChunkKind = EqualChunkKind
succ EqualChunkKind = HorizontalSpaceChunkKind
succ HorizontalSpaceChunkKind = VerticalSpaceChunkKind
succ VerticalSpaceChunkKind = error "ChunkKind.succ: VerticalSpaceChunkKind has no successor"
pred TypedTextChunkKind = OptionalChunkKind
pred TextChunkKind = TypedTextChunkKind
pred PlaceholderChunkKind = TextChunkKind
pred InformativeChunkKind = PlaceholderChunkKind
pred CurrentParameterChunkKind = InformativeChunkKind
pred LeftParenChunkKind = CurrentParameterChunkKind
pred RightParenChunkKind = LeftParenChunkKind
pred LeftBracketChunkKind = RightParenChunkKind
pred RightBracketChunkKind = LeftBracketChunkKind
pred LeftBraceChunkKind = RightBracketChunkKind
pred RightBraceChunkKind = LeftBraceChunkKind
pred LeftAngleChunkKind = RightBraceChunkKind
pred RightAngleChunkKind = LeftAngleChunkKind
pred CommaChunkKind = RightAngleChunkKind
pred ResultTypeChunkKind = CommaChunkKind
pred ColonChunkKind = ResultTypeChunkKind
pred SemiColonChunkKind = ColonChunkKind
pred EqualChunkKind = SemiColonChunkKind
pred HorizontalSpaceChunkKind = EqualChunkKind
pred VerticalSpaceChunkKind = HorizontalSpaceChunkKind
pred OptionalChunkKind = error "ChunkKind.pred: OptionalChunkKind has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from VerticalSpaceChunkKind
fromEnum OptionalChunkKind = 0
fromEnum TypedTextChunkKind = 1
fromEnum TextChunkKind = 2
fromEnum PlaceholderChunkKind = 3
fromEnum InformativeChunkKind = 4
fromEnum CurrentParameterChunkKind = 5
fromEnum LeftParenChunkKind = 6
fromEnum RightParenChunkKind = 7
fromEnum LeftBracketChunkKind = 8
fromEnum RightBracketChunkKind = 9
fromEnum LeftBraceChunkKind = 10
fromEnum RightBraceChunkKind = 11
fromEnum LeftAngleChunkKind = 12
fromEnum RightAngleChunkKind = 13
fromEnum CommaChunkKind = 14
fromEnum ResultTypeChunkKind = 15
fromEnum ColonChunkKind = 16
fromEnum SemiColonChunkKind = 17
fromEnum EqualChunkKind = 18
fromEnum HorizontalSpaceChunkKind = 19
fromEnum VerticalSpaceChunkKind = 20
toEnum 0 = OptionalChunkKind
toEnum 1 = TypedTextChunkKind
toEnum 2 = TextChunkKind
toEnum 3 = PlaceholderChunkKind
toEnum 4 = InformativeChunkKind
toEnum 5 = CurrentParameterChunkKind
toEnum 6 = LeftParenChunkKind
toEnum 7 = RightParenChunkKind
toEnum 8 = LeftBracketChunkKind
toEnum 9 = RightBracketChunkKind
toEnum 10 = LeftBraceChunkKind
toEnum 11 = RightBraceChunkKind
toEnum 12 = LeftAngleChunkKind
toEnum 13 = RightAngleChunkKind
toEnum 14 = CommaChunkKind
toEnum 15 = ResultTypeChunkKind
toEnum 16 = ColonChunkKind
toEnum 17 = SemiColonChunkKind
toEnum 18 = EqualChunkKind
toEnum 19 = HorizontalSpaceChunkKind
toEnum 20 = VerticalSpaceChunkKind
toEnum unmatched = error ("ChunkKind.toEnum: Cannot match " ++ show unmatched)
clang_getCompletionChunkKind :: (Ptr ()) -> (Int) -> IO ((Int))
clang_getCompletionChunkKind a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
clang_getCompletionChunkKind'_ a1' a2' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getCompletionChunkKind :: CompletionString s -> Int -> IO ChunkKind
getCompletionChunkKind (CompletionString ptr) i = clang_getCompletionChunkKind ptr i >>= return . toEnum
clang_getCompletionChunkText :: (Ptr ()) -> (Int) -> IO ((Ptr (ClangString ())))
clang_getCompletionChunkText a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
clang_getCompletionChunkText'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getCompletionChunkText :: CompletionString s -> Int -> IO (ClangString ())
unsafe_getCompletionChunkText (CompletionString ptr) i = clang_getCompletionChunkText ptr i >>= peek
getCompletionChunkText :: ClangBase m => CompletionString s' -> Int -> ClangT s m (ClangString s)
getCompletionChunkText = (registerClangString .) . unsafe_getCompletionChunkText
clang_getCompletionChunkCompletionString :: (Ptr ()) -> (Int) -> IO ((Ptr ()))
clang_getCompletionChunkCompletionString a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
clang_getCompletionChunkCompletionString'_ a1' a2' >>= \res ->
let {res' = id res} in
return (res')
getCompletionChunkCompletionString :: CompletionString s -> Int -> IO (CompletionString s')
getCompletionChunkCompletionString (CompletionString ptr) i =
clang_getCompletionChunkCompletionString ptr i >>= return . CompletionString
clang_getNumCompletionChunks :: (Ptr ()) -> IO ((Int))
clang_getNumCompletionChunks a1 =
let {a1' = id a1} in
clang_getNumCompletionChunks'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getNumCompletionChunks :: CompletionString s -> IO Int
getNumCompletionChunks (CompletionString ptr) = clang_getNumCompletionChunks ptr
clang_getCompletionPriority :: (Ptr ()) -> IO ((Int))
clang_getCompletionPriority a1 =
let {a1' = id a1} in
clang_getCompletionPriority'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getCompletionPriority :: CompletionString s -> IO Int
getCompletionPriority (CompletionString ptr) = clang_getCompletionPriority ptr
clang_getCompletionAvailability :: (Ptr ()) -> IO ((Int))
clang_getCompletionAvailability a1 =
let {a1' = id a1} in
clang_getCompletionAvailability'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getCompletionAvailability :: CompletionString s -> IO AvailabilityKind
getCompletionAvailability (CompletionString ptr) = clang_getCompletionAvailability ptr >>= return . toEnum
clang_getCompletionNumAnnotations :: (Ptr ()) -> IO ((Int))
clang_getCompletionNumAnnotations a1 =
let {a1' = id a1} in
clang_getCompletionNumAnnotations'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
getCompletionNumAnnotations :: CompletionString s -> IO Int
getCompletionNumAnnotations (CompletionString ptr) = clang_getCompletionNumAnnotations ptr
clang_getCompletionAnnotation :: (Ptr ()) -> (Int) -> IO ((Ptr (ClangString ())))
clang_getCompletionAnnotation a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
clang_getCompletionAnnotation'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getCompletionAnnotation :: CompletionString s -> Int -> IO (ClangString ())
unsafe_getCompletionAnnotation (CompletionString ptr) i = clang_getCompletionAnnotation ptr i >>= peek
getCompletionAnnotation :: ClangBase m => CompletionString s' -> Int -> ClangT s m (ClangString s)
getCompletionAnnotation = (registerClangString .) . unsafe_getCompletionAnnotation
clang_getCompletionParent :: (Ptr ()) -> (CInt) -> IO ((Ptr (ClangString ())))
clang_getCompletionParent a1 a2 =
let {a1' = id a1} in
(C2HSImp.with . fromIntegral) a2 $ \a2' ->
clang_getCompletionParent'_ a1' a2' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getCompletionParent :: CompletionString s -> IO (ClangString ())
unsafe_getCompletionParent (CompletionString ptr) = clang_getCompletionParent ptr 0 >>= peek
getCompletionParent :: ClangBase m => CompletionString s' -> ClangT s m (ClangString s)
getCompletionParent = registerClangString . unsafe_getCompletionParent
clang_getCompletionBriefComment :: (Ptr ()) -> IO ((Ptr (ClangString ())))
clang_getCompletionBriefComment a1 =
let {a1' = id a1} in
clang_getCompletionBriefComment'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getCompletionBriefComment :: CompletionString s -> IO (ClangString ())
unsafe_getCompletionBriefComment (CompletionString ptr) = clang_getCompletionBriefComment ptr >>= peek
getCompletionBriefComment :: ClangBase m => CompletionString s' -> ClangT s m (ClangString s)
getCompletionBriefComment = registerClangString . unsafe_getCompletionBriefComment
clang_getCursorCompletionString :: (Cursor a) -> IO ((Ptr (ClangString ())))
clang_getCursorCompletionString a1 =
withVoided a1 $ \a1' ->
clang_getCursorCompletionString'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getCursorCompletionString :: Cursor s' -> IO (ClangString ())
unsafe_getCursorCompletionString c =
clang_getCursorCompletionString c >>= peek
getCursorCompletionString :: ClangBase m => Cursor s' -> ClangT s m (CompletionString s)
getCursorCompletionString c =
unsafeCoerce <$> (liftIO $ unsafe_getCursorCompletionString c)
data CodeCompleteFlags = IncludeMacros
| IncludeCodePatterns
| IncludeBriefComments
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum CodeCompleteFlags where
succ IncludeMacros = IncludeCodePatterns
succ IncludeCodePatterns = IncludeBriefComments
succ IncludeBriefComments = error "CodeCompleteFlags.succ: IncludeBriefComments has no successor"
pred IncludeCodePatterns = IncludeMacros
pred IncludeBriefComments = IncludeCodePatterns
pred IncludeMacros = error "CodeCompleteFlags.pred: IncludeMacros has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from IncludeBriefComments
fromEnum IncludeMacros = 1
fromEnum IncludeCodePatterns = 2
fromEnum IncludeBriefComments = 4
toEnum 1 = IncludeMacros
toEnum 2 = IncludeCodePatterns
toEnum 4 = IncludeBriefComments
toEnum unmatched = error ("CodeCompleteFlags.toEnum: Cannot match " ++ show unmatched)
instance BitFlags CodeCompleteFlags where
toBit IncludeMacros = 0x01
toBit IncludeCodePatterns = 0x02
toBit IncludeBriefComments = 0x04
defaultCodeCompleteOptions :: IO ((Int))
defaultCodeCompleteOptions =
defaultCodeCompleteOptions'_ >>= \res ->
let {res' = fromIntegral res} in
return (res')
newtype CodeCompleteResults s = CodeCompleteResults { unCodeCompleteResults :: Ptr () }
deriving (Eq, Ord, Typeable)
instance ClangValue CodeCompleteResults
clang_disposeCodeCompleteResults :: (Ptr ()) -> IO ()
clang_disposeCodeCompleteResults a1 =
let {a1' = id a1} in
clang_disposeCodeCompleteResults'_ a1' >>
return ()
disposeCodeCompleteResults :: CodeCompleteResults s -> IO ()
disposeCodeCompleteResults rs = clang_disposeCodeCompleteResults (unCodeCompleteResults rs)
registerCodeCompleteResults :: ClangBase m => IO (CodeCompleteResults ())
-> ClangT s m (CodeCompleteResults s)
registerCodeCompleteResults action = do
(_, ccrs) <- clangAllocate (action >>= return . unsafeCoerce)
disposeCodeCompleteResults
return ccrs
clang_codeCompleteAt :: (Ptr ()) -> (CString) -> (Int) -> (Int) -> (Ptr ()) -> (Int) -> (Int) -> IO ((Ptr ()))
clang_codeCompleteAt a1 a2 a3 a4 a5 a6 a7 =
let {a1' = id a1} in
(flip ($)) a2 $ \a2' ->
let {a3' = fromIntegral a3} in
let {a4' = fromIntegral a4} in
let {a5' = id a5} in
let {a6' = fromIntegral a6} in
let {a7' = fromIntegral a7} in
clang_codeCompleteAt'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
let {res' = id res} in
return (res')
unsafe_codeCompleteAt :: TranslationUnit s -> String -> Int -> Int -> Ptr CUnsavedFile -> Int -> Int -> IO (CodeCompleteResults ())
unsafe_codeCompleteAt tu s i1 i2 ufs nufs i3 =
withCString s (\sPtr -> clang_codeCompleteAt (unTranslationUnit tu) sPtr i1 i2 (castPtr ufs) nufs i3 >>= return . CodeCompleteResults)
codeCompleteAt :: ClangBase m => TranslationUnit s' -> String -> Int -> Int
-> DV.Vector UnsavedFile -> Int -> ClangT s m (CodeCompleteResults s)
codeCompleteAt tu f l c ufs os =
registerCodeCompleteResults $
withUnsavedFiles ufs $ \ufsPtr ufsLen ->
unsafe_codeCompleteAt tu f l c ufsPtr ufsLen os
codeCompleteGetNumResults' :: (Ptr ()) -> IO ((Int))
codeCompleteGetNumResults' a1 =
let {a1' = id a1} in
codeCompleteGetNumResults''_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
codeCompleteGetNumResults :: CodeCompleteResults s -> IO Int
codeCompleteGetNumResults rs = codeCompleteGetNumResults' (unCodeCompleteResults rs)
codeCompleteGetResult' :: (Ptr ()) -> (CInt) -> (Ptr (Ptr ())) -> IO ((CInt))
codeCompleteGetResult' a1 a2 a3 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
let {a3' = id a3} in
codeCompleteGetResult''_ a1' a2' a3' >>= \res ->
let {res' = id res} in
return (res')
unsafe_codeCompleteGetResult :: CodeCompleteResults s -> Int -> IO (CompletionString (), CursorKind)
unsafe_codeCompleteGetResult rs idx = do
sPtr <- mallocBytes (sizeOf (undefined :: (Ptr (Ptr ()))))
kind <- codeCompleteGetResult' (unCodeCompleteResults rs) (fromIntegral idx) (castPtr sPtr)
return ((CompletionString sPtr), toEnum (fromIntegral kind))
codeCompleteGetResult :: ClangBase m => CodeCompleteResults s' -> Int
-> ClangT s m (CompletionString s, CursorKind)
codeCompleteGetResult rs n = do
(string, kind) <- liftIO $ unsafe_codeCompleteGetResult rs n
return (unsafeCoerce string, kind)
clang_sortCodeCompletionResults :: (Ptr ()) -> (Int) -> IO ()
clang_sortCodeCompletionResults a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
clang_sortCodeCompletionResults'_ a1' a2' >>
return ()
sortCodeCompletionResults :: CodeCompleteResults s -> IO ()
sortCodeCompletionResults rs =
let results = unCodeCompleteResults rs in
do
rPtr <- peek (results `plusPtr` offsetCXCodeCompleteResultsResults)
numRs <- peek (results `plusPtr` offsetCXCodeCompleteResultsNumResults)
clang_sortCodeCompletionResults rPtr numRs
clang_codeCompleteGetNumDiagnostics :: (Ptr ()) -> IO ((Int))
clang_codeCompleteGetNumDiagnostics a1 =
let {a1' = id a1} in
clang_codeCompleteGetNumDiagnostics'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
codeCompleteGetNumDiagnostics :: CodeCompleteResults s -> IO Int
codeCompleteGetNumDiagnostics rs = clang_codeCompleteGetNumDiagnostics (unCodeCompleteResults rs)
clang_codeCompleteGetDiagnostic :: (Ptr ()) -> (Int) -> IO ((Ptr ()))
clang_codeCompleteGetDiagnostic a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
clang_codeCompleteGetDiagnostic'_ a1' a2' >>= \res ->
let {res' = id res} in
return (res')
unsafe_codeCompleteGetDiagnostic :: CodeCompleteResults s -> Int -> IO (Diagnostic ())
unsafe_codeCompleteGetDiagnostic rs idx =
clang_codeCompleteGetDiagnostic (unCodeCompleteResults rs) idx >>= return . mkDiagnostic
codeCompleteGetDiagnostic :: ClangBase m => CodeCompleteResults s' -> Int
-> ClangT s m (Diagnostic s)
codeCompleteGetDiagnostic = (registerDiagnostic .) . unsafe_codeCompleteGetDiagnostic
data CompletionContext = UnexposedCompletionContext
| AnyTypeCompletionContext
| AnyValueCompletionContext
| ObjCObjectValueCompletionContext
| ObjCSelectorValueCompletionContext
| CXXClassTypeValueCompletionContext
| DotMemberAccessCompletionContext
| ArrowMemberAccessCompletionContext
| ObjCPropertyAccessCompletionContext
| EnumTagCompletionContext
| UnionTagCompletionContext
| StructTagCompletionContext
| ClassTagCompletionContext
| NamespaceCompletionContext
| NestedNameSpecifierCompletionContext
| ObjCInterfaceCompletionContext
| ObjCProtocolCompletionContext
| ObjCCategoryCompletionContext
| ObjCInstanceMessageCompletionContext
| ObjCClassMessageCompletionContext
| ObjCSelectorNameCompletionContext
| MacroNameCompletionContext
| NaturalLanguageCompletionContext
deriving (Bounded,Eq,Ord,Read,Show,Typeable)
instance Enum CompletionContext where
succ UnexposedCompletionContext = AnyTypeCompletionContext
succ AnyTypeCompletionContext = AnyValueCompletionContext
succ AnyValueCompletionContext = ObjCObjectValueCompletionContext
succ ObjCObjectValueCompletionContext = ObjCSelectorValueCompletionContext
succ ObjCSelectorValueCompletionContext = CXXClassTypeValueCompletionContext
succ CXXClassTypeValueCompletionContext = DotMemberAccessCompletionContext
succ DotMemberAccessCompletionContext = ArrowMemberAccessCompletionContext
succ ArrowMemberAccessCompletionContext = ObjCPropertyAccessCompletionContext
succ ObjCPropertyAccessCompletionContext = EnumTagCompletionContext
succ EnumTagCompletionContext = UnionTagCompletionContext
succ UnionTagCompletionContext = StructTagCompletionContext
succ StructTagCompletionContext = ClassTagCompletionContext
succ ClassTagCompletionContext = NamespaceCompletionContext
succ NamespaceCompletionContext = NestedNameSpecifierCompletionContext
succ NestedNameSpecifierCompletionContext = ObjCInterfaceCompletionContext
succ ObjCInterfaceCompletionContext = ObjCProtocolCompletionContext
succ ObjCProtocolCompletionContext = ObjCCategoryCompletionContext
succ ObjCCategoryCompletionContext = ObjCInstanceMessageCompletionContext
succ ObjCInstanceMessageCompletionContext = ObjCClassMessageCompletionContext
succ ObjCClassMessageCompletionContext = ObjCSelectorNameCompletionContext
succ ObjCSelectorNameCompletionContext = MacroNameCompletionContext
succ MacroNameCompletionContext = NaturalLanguageCompletionContext
succ NaturalLanguageCompletionContext = error "CompletionContext.succ: NaturalLanguageCompletionContext has no successor"
pred AnyTypeCompletionContext = UnexposedCompletionContext
pred AnyValueCompletionContext = AnyTypeCompletionContext
pred ObjCObjectValueCompletionContext = AnyValueCompletionContext
pred ObjCSelectorValueCompletionContext = ObjCObjectValueCompletionContext
pred CXXClassTypeValueCompletionContext = ObjCSelectorValueCompletionContext
pred DotMemberAccessCompletionContext = CXXClassTypeValueCompletionContext
pred ArrowMemberAccessCompletionContext = DotMemberAccessCompletionContext
pred ObjCPropertyAccessCompletionContext = ArrowMemberAccessCompletionContext
pred EnumTagCompletionContext = ObjCPropertyAccessCompletionContext
pred UnionTagCompletionContext = EnumTagCompletionContext
pred StructTagCompletionContext = UnionTagCompletionContext
pred ClassTagCompletionContext = StructTagCompletionContext
pred NamespaceCompletionContext = ClassTagCompletionContext
pred NestedNameSpecifierCompletionContext = NamespaceCompletionContext
pred ObjCInterfaceCompletionContext = NestedNameSpecifierCompletionContext
pred ObjCProtocolCompletionContext = ObjCInterfaceCompletionContext
pred ObjCCategoryCompletionContext = ObjCProtocolCompletionContext
pred ObjCInstanceMessageCompletionContext = ObjCCategoryCompletionContext
pred ObjCClassMessageCompletionContext = ObjCInstanceMessageCompletionContext
pred ObjCSelectorNameCompletionContext = ObjCClassMessageCompletionContext
pred MacroNameCompletionContext = ObjCSelectorNameCompletionContext
pred NaturalLanguageCompletionContext = MacroNameCompletionContext
pred UnexposedCompletionContext = error "CompletionContext.pred: UnexposedCompletionContext has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from NaturalLanguageCompletionContext
fromEnum UnexposedCompletionContext = 0
fromEnum AnyTypeCompletionContext = 1
fromEnum AnyValueCompletionContext = 2
fromEnum ObjCObjectValueCompletionContext = 4
fromEnum ObjCSelectorValueCompletionContext = 8
fromEnum CXXClassTypeValueCompletionContext = 16
fromEnum DotMemberAccessCompletionContext = 32
fromEnum ArrowMemberAccessCompletionContext = 64
fromEnum ObjCPropertyAccessCompletionContext = 128
fromEnum EnumTagCompletionContext = 256
fromEnum UnionTagCompletionContext = 512
fromEnum StructTagCompletionContext = 1024
fromEnum ClassTagCompletionContext = 2048
fromEnum NamespaceCompletionContext = 4096
fromEnum NestedNameSpecifierCompletionContext = 8192
fromEnum ObjCInterfaceCompletionContext = 16384
fromEnum ObjCProtocolCompletionContext = 32768
fromEnum ObjCCategoryCompletionContext = 65536
fromEnum ObjCInstanceMessageCompletionContext = 131072
fromEnum ObjCClassMessageCompletionContext = 262144
fromEnum ObjCSelectorNameCompletionContext = 524288
fromEnum MacroNameCompletionContext = 1048576
fromEnum NaturalLanguageCompletionContext = 2097152
toEnum 0 = UnexposedCompletionContext
toEnum 1 = AnyTypeCompletionContext
toEnum 2 = AnyValueCompletionContext
toEnum 4 = ObjCObjectValueCompletionContext
toEnum 8 = ObjCSelectorValueCompletionContext
toEnum 16 = CXXClassTypeValueCompletionContext
toEnum 32 = DotMemberAccessCompletionContext
toEnum 64 = ArrowMemberAccessCompletionContext
toEnum 128 = ObjCPropertyAccessCompletionContext
toEnum 256 = EnumTagCompletionContext
toEnum 512 = UnionTagCompletionContext
toEnum 1024 = StructTagCompletionContext
toEnum 2048 = ClassTagCompletionContext
toEnum 4096 = NamespaceCompletionContext
toEnum 8192 = NestedNameSpecifierCompletionContext
toEnum 16384 = ObjCInterfaceCompletionContext
toEnum 32768 = ObjCProtocolCompletionContext
toEnum 65536 = ObjCCategoryCompletionContext
toEnum 131072 = ObjCInstanceMessageCompletionContext
toEnum 262144 = ObjCClassMessageCompletionContext
toEnum 524288 = ObjCSelectorNameCompletionContext
toEnum 1048576 = MacroNameCompletionContext
toEnum 2097152 = NaturalLanguageCompletionContext
toEnum unmatched = error ("CompletionContext.toEnum: Cannot match " ++ show unmatched)
instance BitFlags CompletionContext where
type FlagInt CompletionContext = Int64
toBit UnexposedCompletionContext = 0x0
toBit AnyTypeCompletionContext = 0x1
toBit AnyValueCompletionContext = 0x2
toBit ObjCObjectValueCompletionContext = 0x4
toBit ObjCSelectorValueCompletionContext = 0x8
toBit CXXClassTypeValueCompletionContext = 0x10
toBit DotMemberAccessCompletionContext = 0x20
toBit ArrowMemberAccessCompletionContext = 0x40
toBit ObjCPropertyAccessCompletionContext = 0x80
toBit EnumTagCompletionContext = 0x100
toBit UnionTagCompletionContext = 0x200
toBit StructTagCompletionContext = 0x400
toBit ClassTagCompletionContext = 0x800
toBit NamespaceCompletionContext = 0x1000
toBit NestedNameSpecifierCompletionContext = 0x2000
toBit ObjCInterfaceCompletionContext = 0x4000
toBit ObjCProtocolCompletionContext = 0x8000
toBit ObjCCategoryCompletionContext = 0x10000
toBit ObjCInstanceMessageCompletionContext = 0x20000
toBit ObjCClassMessageCompletionContext = 0x40000
toBit ObjCSelectorNameCompletionContext = 0x80000
toBit MacroNameCompletionContext = 0x100000
toBit NaturalLanguageCompletionContext = 0x200000
clang_codeCompleteGetContexts :: (Ptr ()) -> IO ((Int64))
clang_codeCompleteGetContexts a1 =
let {a1' = id a1} in
clang_codeCompleteGetContexts'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
codeCompleteGetContexts :: CodeCompleteResults s -> IO Int64
codeCompleteGetContexts rs = clang_codeCompleteGetContexts (unCodeCompleteResults rs)
clang_codeCompleteGetContainerKind :: (Ptr ()) -> (Ptr CUInt) -> IO ((Int))
clang_codeCompleteGetContainerKind a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
clang_codeCompleteGetContainerKind'_ a1' a2' >>= \res ->
let {res' = fromIntegral res} in
return (res')
codeCompleteGetContainerKind :: CodeCompleteResults s -> IO (CursorKind, Bool)
codeCompleteGetContainerKind rs =
alloca (\(iPtr :: (Ptr CUInt)) -> do
k <- clang_codeCompleteGetContainerKind (unCodeCompleteResults rs) iPtr
bool <- peek iPtr
return (toEnum k, toBool ((fromIntegral bool) :: Int)))
clang_codeCompleteGetContainerUSR :: (Ptr ()) -> IO ((Ptr (ClangString ())))
clang_codeCompleteGetContainerUSR a1 =
let {a1' = id a1} in
clang_codeCompleteGetContainerUSR'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_codeCompleteGetContainerUSR :: CodeCompleteResults s -> IO (ClangString ())
unsafe_codeCompleteGetContainerUSR rs = clang_codeCompleteGetContainerUSR (unCodeCompleteResults rs) >>= peek
codeCompleteGetContainerUSR :: ClangBase m => CodeCompleteResults s' -> ClangT s m (ClangString s)
codeCompleteGetContainerUSR = registerClangString . unsafe_codeCompleteGetContainerUSR
clang_codeCompleteGetObjCSelector :: (Ptr ()) -> IO ((Ptr (ClangString ())))
clang_codeCompleteGetObjCSelector a1 =
let {a1' = id a1} in
clang_codeCompleteGetObjCSelector'_ a1' >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_codeCompleteGetObjCSelector :: CodeCompleteResults s -> IO (ClangString ())
unsafe_codeCompleteGetObjCSelector rs = clang_codeCompleteGetObjCSelector (unCodeCompleteResults rs) >>= peek
codeCompleteGetObjCSelector :: ClangBase m => CodeCompleteResults s' -> ClangT s m (ClangString s)
codeCompleteGetObjCSelector = registerClangString . unsafe_codeCompleteGetObjCSelector
clang_getClangVersion :: IO ((Ptr (ClangString ())))
clang_getClangVersion =
clang_getClangVersion'_ >>= \res ->
let {res' = castPtr res} in
return (res')
unsafe_getClangVersion :: IO (ClangString ())
unsafe_getClangVersion = clang_getClangVersion >>= peek
getClangVersion :: ClangBase m => ClangT s m (ClangString s)
getClangVersion = registerClangString $ unsafe_getClangVersion
toggleCrashRecovery' :: (Int) -> IO ()
toggleCrashRecovery' a1 =
let {a1' = fromIntegral a1} in
toggleCrashRecovery''_ a1' >>
return ()
toggleCrashRecovery :: Bool -> IO ()
toggleCrashRecovery b = toggleCrashRecovery' (fromBool b)
data Inclusion s = Inclusion !(File s) !(SourceLocation s) !Bool
deriving (Eq, Ord, Typeable)
instance ClangValue Inclusion
instance Storable (Inclusion s) where
sizeOf _ = sizeOfInclusion
alignment _ = alignOfInclusion
peek p = do
let fromCUChar = fromIntegral :: Num b => CUChar -> b
file <- File <$> peekByteOff p offsetInclusionInclusion
sl <- peekByteOff p offsetInclusionLocation
isDirect :: Int <- fromCUChar <$> peekByteOff p offsetInclusionIsDirect
return $! Inclusion file sl (if isDirect == 0 then False else True)
poke p (Inclusion (File file) sl isDirect) = do
let toCUChar = fromIntegral :: Integral a => a -> CUChar
pokeByteOff p offsetInclusionInclusion file
pokeByteOff p offsetInclusionLocation sl
pokeByteOff p offsetInclusionIsDirect
(toCUChar $ if isDirect then 1 :: Int else 0)
type InclusionList s = DVS.Vector (Inclusion s)
instance ClangValueList Inclusion
data UnsafeInclusionList = UnsafeInclusionList !(Ptr ()) !Int
freeInclusionList' :: (Ptr ()) -> IO ()
freeInclusionList' a1 =
let {a1' = id a1} in
freeInclusionList''_ a1' >>
return ()
freeInclusions :: InclusionList s -> IO ()
freeInclusions is =
let (isPtr, n) = fromInclusionList is in
freeInclusionList' isPtr
registerInclusionList :: ClangBase m => IO UnsafeInclusionList -> ClangT s m (InclusionList s)
registerInclusionList action = do
(_, inclusionList) <- clangAllocate (action >>= mkSafe) freeInclusions
return inclusionList
where
mkSafe (UnsafeInclusionList is n) = do
fptr <- newForeignPtr_ (castPtr is)
return $ DVS.unsafeFromForeignPtr fptr 0 n
fromInclusionList :: InclusionList s -> (Ptr (), Int)
fromInclusionList is = let (p, _, _) = DVS.unsafeToForeignPtr is in
(castPtr $ Foreign.ForeignPtr.Unsafe.unsafeForeignPtrToPtr p, DVS.length is)
toInclusionList :: (Ptr (), Int) -> UnsafeInclusionList
toInclusionList (is, n) = UnsafeInclusionList is n
getInclusions' :: (Ptr ()) -> (Ptr (Ptr ())) -> IO ((CUInt))
getInclusions' a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
alloca $ \a3' ->
getInclusions''_ a1' a2' a3' >>
peek a3'>>= \a3'' ->
return (a3'')
unsafe_getInclusions :: TranslationUnit s -> IO UnsafeInclusionList
unsafe_getInclusions tu = do
iPtrPtr <- mallocBytes 8
n <- getInclusions' (unTranslationUnit tu) (castPtr iPtrPtr)
firstInclusion <- peek (castPtr iPtrPtr :: Ptr (Ptr ()))
free iPtrPtr
return (toInclusionList (firstInclusion, fromIntegral n))
getInclusions :: ClangBase m => TranslationUnit s' -> ClangT s m (InclusionList s)
getInclusions = registerInclusionList . unsafe_getInclusions
newtype Remapping s = Remapping { unRemapping :: Ptr () }
deriving (Eq, Ord, Typeable)
instance ClangValue Remapping
mkRemapping :: Ptr () -> Remapping ()
mkRemapping = Remapping
clang_remap_dispose :: (Ptr ()) -> IO ()
clang_remap_dispose a1 =
let {a1' = id a1} in
clang_remap_dispose'_ a1' >>
return ()
remap_dispose :: Remapping s -> IO ()
remap_dispose d = clang_remap_dispose (unRemapping d)
registerRemapping :: ClangBase m => IO (Remapping ()) -> ClangT s m (Remapping s)
registerRemapping action = do
(_, idx) <- clangAllocate (action >>= return . unsafeCoerce)
(\i -> remap_dispose i)
return idx
maybeRemapping :: Remapping s' -> Maybe (Remapping s)
maybeRemapping (Remapping p) | p == nullPtr = Nothing
maybeRemapping f = Just (unsafeCoerce f)
unMaybeRemapping :: Maybe (Remapping s') -> Remapping s
unMaybeRemapping (Just f) = unsafeCoerce f
unMaybeRemapping Nothing = Remapping nullPtr
clang_getRemappings :: (CString) -> IO ((Ptr ()))
clang_getRemappings a1 =
(flip ($)) a1 $ \a1' ->
clang_getRemappings'_ a1' >>= \res ->
let {res' = id res} in
return (res')
unsafe_getRemappings :: FilePath -> IO (Maybe (Remapping ()))
unsafe_getRemappings fp =
withCString fp (\sPtr -> clang_getRemappings sPtr >>= return . maybeRemapping . mkRemapping )
getRemappings :: ClangBase m => FilePath -> ClangT s m (Maybe (Remapping s))
getRemappings path = do
mRemappings <- liftIO $ unsafe_getRemappings path
case mRemappings of
Just remappings -> Just <$> registerRemapping (return remappings)
Nothing -> return Nothing
clang_getRemappingsFromFileList :: (Ptr CString) -> (Int) -> IO ((Ptr ()))
clang_getRemappingsFromFileList a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
clang_getRemappingsFromFileList'_ a1' a2' >>= \res ->
let {res' = id res} in
return (res')
unsafe_getRemappingsFromFileList :: Ptr CString -> Int -> IO (Maybe (Remapping ()))
unsafe_getRemappingsFromFileList paths numPaths =
clang_getRemappingsFromFileList paths numPaths >>= return . maybeRemapping . mkRemapping
getRemappingsFromFileList :: ClangBase m => [FilePath] -> ClangT s m (Maybe (Remapping s))
getRemappingsFromFileList paths = do
mRemappings <- liftIO $ withStringList paths unsafe_getRemappingsFromFileList
case mRemappings of
Just remappings -> Just <$> registerRemapping (return remappings)
Nothing -> return Nothing
clang_remap_getNumFiles :: (Ptr ()) -> IO ((Int))
clang_remap_getNumFiles a1 =
let {a1' = id a1} in
clang_remap_getNumFiles'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
remap_getNumFiles :: Remapping s -> IO Int
remap_getNumFiles remaps =
clang_remap_getNumFiles (unRemapping remaps)
clang_remap_getFilenames :: (Ptr ()) -> (Int) -> (Ptr ()) -> (Ptr ()) -> IO ()
clang_remap_getFilenames a1 a2 a3 a4 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
let {a3' = id a3} in
let {a4' = id a4} in
clang_remap_getFilenames'_ a1' a2' a3' a4' >>
return ()
unsafe_remap_getFilenames :: Remapping s -> Int -> IO (ClangString (), ClangString ())
unsafe_remap_getFilenames remaps idx = do
origPtr <- mallocBytes (sizeOf (undefined :: (Ptr (ClangString ()))))
txPtr <- mallocBytes (sizeOf (undefined :: (Ptr (ClangString ()))))
clang_remap_getFilenames (unRemapping remaps) idx origPtr txPtr
orig <- peek (castPtr origPtr)
tx <- peek (castPtr txPtr)
free origPtr
free txPtr
return (orig, tx)
remap_getFilenames :: ClangBase m => Remapping s' -> Int -> ClangT s m (ClangString s, ClangString s)
remap_getFilenames r idx = do
(orig, tr) <- liftIO $ unsafe_remap_getFilenames r idx
(,) <$> registerClangString (return orig) <*> registerClangString (return tr)
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_createIndex"
clang_createIndex'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_disposeIndex"
clang_disposeIndex'_ :: ((C2HSImp.Ptr ()) -> (IO ()))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_CXIndex_setGlobalOptions"
clang_CXIndex_setGlobalOptions'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_CXIndex_getGlobalOptions"
clang_CXIndex_getGlobalOptions'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_disposeTranslationUnit"
clang_disposeTranslationUnit'_ :: ((C2HSImp.Ptr ()) -> (IO ()))
foreign import ccall safe "Clang/Internal/FFI.chs.h freeClangString"
freeClangString'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getCString"
clang_getCString'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr C2HSImp.CChar)))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getFileName"
clang_getFileName'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getFileUniqueID"
clang_getFileUniqueID'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt)))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_isFileMultipleIncludeGuarded"
clang_isFileMultipleIncludeGuarded'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt)))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getFile"
clang_getFile'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr C2HSImp.CChar) -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getNullLocation"
clang_getNullLocation'_ :: (IO (C2HSImp.Ptr ()))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_equalLocations"
clang_equalLocations'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt)))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getLocation"
clang_getLocation'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getLocationForOffset"
clang_getLocationForOffset'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ())))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Location_isInSystemHeader"
clang_Location_isInSystemHeader'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Location_isFromMainFile"
clang_Location_isFromMainFile'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getNullRange"
clang_getNullRange'_ :: (IO (C2HSImp.Ptr ()))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getRange"
clang_getRange'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_equalRanges"
clang_equalRanges'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt)))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Range_isNull"
clang_Range_isNull'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getExpansionLocation"
clang_getExpansionLocation'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (IO ()))))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getPresumedLocation"
clang_getPresumedLocation'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (IO ())))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getSpellingLocation"
clang_getSpellingLocation'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (IO ()))))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getFileLocation"
clang_getFileLocation'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (IO ()))))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getRangeStart"
clang_getRangeStart'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getRangeEnd"
clang_getRangeEnd'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_disposeDiagnostic"
clang_disposeDiagnostic'_ :: ((C2HSImp.Ptr ()) -> (IO ()))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_disposeDiagnosticSet"
clang_disposeDiagnosticSet'_ :: ((C2HSImp.Ptr ()) -> (IO ()))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getNumDiagnosticsInSet"
clang_getNumDiagnosticsInSet'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getDiagnosticInSet"
clang_getDiagnosticInSet'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_loadDiagnostics"
clang_loadDiagnostics'_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> ((C2HSImp.Ptr C2HSImp.CInt) -> ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getChildDiagnostics"
clang_getChildDiagnostics'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getNumDiagnostics"
clang_getNumDiagnostics'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getDiagnostic"
clang_getDiagnostic'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getDiagnosticSetFromTU"
clang_getDiagnosticSetFromTU'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_formatDiagnostic"
clang_formatDiagnostic'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_defaultDiagnosticDisplayOptions"
clang_defaultDiagnosticDisplayOptions'_ :: (IO C2HSImp.CUInt)
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getDiagnosticSeverity"
clang_getDiagnosticSeverity'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getDiagnosticLocation"
clang_getDiagnosticLocation'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getDiagnosticSpelling"
clang_getDiagnosticSpelling'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getDiagnosticOption"
clang_getDiagnosticOption'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getDiagnosticCategory"
clang_getDiagnosticCategory'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getDiagnosticCategoryText"
clang_getDiagnosticCategoryText'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getDiagnosticNumRanges"
clang_getDiagnosticNumRanges'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getDiagnosticRange"
clang_getDiagnosticRange'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getDiagnosticNumFixIts"
clang_getDiagnosticNumFixIts'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getDiagnosticFixIt"
clang_getDiagnosticFixIt'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getTranslationUnitSpelling"
clang_getTranslationUnitSpelling'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_createTranslationUnitFromSourceFile"
clang_createTranslationUnitFromSourceFile'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr C2HSImp.CChar) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ()))))))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_createTranslationUnit"
clang_createTranslationUnit'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr C2HSImp.CChar) -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_defaultEditingTranslationUnitOptions"
defaultEditingTranslationUnitOptions'_ :: (IO C2HSImp.CUInt)
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_parseTranslationUnit"
clang_parseTranslationUnit'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr C2HSImp.CChar) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ())))))))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_setClangResourcesPath"
clang_setClangResourcesPath'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr C2HSImp.CChar) -> (IO ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_defaultSaveOptions"
clang_defaultSaveOptions'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_saveTranslationUnit"
clang_saveTranslationUnit'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr C2HSImp.CChar) -> (C2HSImp.CUInt -> (IO C2HSImp.CInt))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_defaultReparseOptions"
clang_defaultReparseOptions'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_reparseTranslationUnit"
clang_reparseTranslationUnit'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO C2HSImp.CInt)))))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getTranslationUnitCursor"
clang_getTranslationUnitCursor'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_hashCursor"
clang_hashCursor'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getCursorLinkage"
clang_getCursorLinkage'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getCursorAvailability"
clang_getCursorAvailability'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_disposeCXPlatformAvailability"
clang_disposeCXPlatformAvailability'_ :: ((C2HSImp.Ptr ()) -> (IO ()))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getCursorPlatformAvailability"
clang_getCursorPlatformAvailability'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr C2HSImp.CInt) -> ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr C2HSImp.CInt) -> ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO C2HSImp.CInt))))))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getCursorLanguage"
clang_getCursorLanguage'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Cursor_getTranslationUnit"
clang_Cursor_getTranslationUnit'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_disposeCXCursorSet"
clang_disposeCXCursorSet'_ :: ((C2HSImp.Ptr ()) -> (IO ()))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_createCXCursorSet"
clang_createCXCursorSet'_ :: (IO (C2HSImp.Ptr ()))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_CXCursorSet_contains"
clang_CXCursorSet_contains'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt)))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_CXCursorSet_insert"
clang_CXCursorSet_insert'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt)))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getCursorSemanticParent"
clang_getCursorSemanticParent'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getCursorLexicalParent"
clang_getCursorLexicalParent'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_disposeOverriddenCursors"
clang_disposeOverriddenCursors'_ :: ((C2HSImp.Ptr ()) -> (IO ()))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getOverriddenCursors"
clang_getOverriddenCursors'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (IO ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getIncludedFile"
clang_getIncludedFile'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getCursor"
clang_getCursor'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getCursorLocation"
clang_getCursorLocation'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getCursorExtent"
clang_getCursorExtent'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getCursorType"
clang_getCursorType'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getTypeSpelling"
clang_getTypeSpelling'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getTypedefDeclUnderlyingType"
clang_getTypedefDeclUnderlyingType'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getEnumDeclIntegerType"
clang_getEnumDeclIntegerType'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getEnumConstantDeclValue"
clang_getEnumConstantDeclValue'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CLLong))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getEnumConstantDeclUnsignedValue"
clang_getEnumConstantDeclUnsignedValue'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CULLong))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getFieldDeclBitWidth"
clang_getFieldDeclBitWidth'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Cursor_getNumArguments"
clang_Cursor_getNumArguments'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_Cursor_getArgument"
clang_Cursor_getArgument'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_equalTypes"
clang_equalTypes'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt)))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getCanonicalType"
clang_getCanonicalType'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_isConstQualifiedType"
clang_isConstQualifiedType'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_isVolatileQualifiedType"
clang_isVolatileQualifiedType'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_isRestrictQualifiedType"
clang_isRestrictQualifiedType'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getPointeeType"
clang_getPointeeType'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getTypeDeclaration"
clang_getTypeDeclaration'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getDeclObjCTypeEncoding"
clang_getDeclObjCTypeEncoding'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getTypeKindSpelling"
clang_getTypeKindSpelling'_ :: (C2HSImp.CInt -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getFunctionTypeCallingConv"
clang_getFunctionTypeCallingConv'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getResultType"
clang_getResultType'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getNumArgTypes"
clang_getNumArgTypes'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getArgType"
clang_getArgType'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_isFunctionTypeVariadic"
clang_isFunctionTypeVariadic'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getCursorResultType"
clang_getCursorResultType'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_isPODType"
clang_isPODType'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getElementType"
clang_getElementType'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getNumElements"
clang_getNumElements'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CLLong))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getArrayElementType"
clang_getArrayElementType'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getArraySize"
clang_getArraySize'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CLLong))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Type_getAlignOf"
clang_Type_getAlignOf'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CLLong))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_Type_getClassType"
clang_Type_getClassType'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Type_getSizeOf"
clang_Type_getSizeOf'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CLLong))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Type_getOffsetOf"
clang_Type_getOffsetOf'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr C2HSImp.CChar) -> (IO C2HSImp.CLLong)))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Type_getCXXRefQualifier"
clang_Type_getCXXRefQualifier'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Cursor_isBitField"
clang_Cursor_isBitField'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_isVirtualBase"
clang_isVirtualBase'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getCXXAccessSpecifier"
clang_getCXXAccessSpecifier'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getNumOverloadedDecls"
clang_getNumOverloadedDecls'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getOverloadedDecl"
clang_getOverloadedDecl'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getIBOutletCollectionType"
clang_getIBOutletCollectionType'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h freeCursorList"
freeCursorList''_ :: ((C2HSImp.Ptr ()) -> (IO ()))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__getChildren"
getChildren''_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (IO ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__getDescendants"
getDescendants''_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (IO ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h getDeclarations"
getDeclarations''_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (IO ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h getReferences"
getReferences''_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (IO ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h getDeclarationsAndReferences"
getDeclarationsAndReferences''_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (IO ()))))))
foreign import ccall safe "Clang/Internal/FFI.chs.h freeParentedCursorList"
freeParentedCursorList''_ :: ((C2HSImp.Ptr ()) -> (IO ()))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__getParentedDescendants"
getParentedDescendants''_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (IO ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h getParentedDeclarations"
getParentedDeclarations''_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (IO ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h getParentedReferences"
getParentedReferences''_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (IO ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h getParentedDeclarationsAndReferences"
getParentedDeclarationsAndReferences''_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (IO ()))))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getCursorUSR"
clang_getCursorUSR'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_constructUSR_ObjCClass"
clang_constructUSR_ObjCClass'_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_constructUSR_ObjCCategory"
clang_constructUSR_ObjCCategory'_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> ((C2HSImp.Ptr C2HSImp.CChar) -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_constructUSR_ObjCProtocol"
clang_constructUSR_ObjCProtocol'_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_constructUSR_ObjCIvar"
clang_constructUSR_ObjCIvar'_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_constructUSR_ObjCMethod"
clang_constructUSR_ObjCMethod'_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_constructUSR_ObjCProperty"
clang_constructUSR_ObjCProperty'_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getCursorSpelling"
clang_getCursorSpelling'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_Cursor_getSpellingNameRange"
clang_Cursor_getSpellingNameRange'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ())))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getCursorDisplayName"
clang_getCursorDisplayName'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getCursorReferenced"
clang_getCursorReferenced'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getCursorDefinition"
clang_getCursorDefinition'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_isCursorDefinition"
clang_isCursorDefinition'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Cursor_isDynamicCall"
clang_Cursor_isDynamicCall'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getCanonicalCursor"
clang_getCanonicalCursor'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Cursor_getObjCSelectorIndex"
clang_Cursor_getObjCSelectorIndex'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_Cursor_getReceiverType"
clang_Cursor_getReceiverType'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Cursor_getObjCPropertyAttributes"
clang_Cursor_getObjCPropertyAttributes'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO C2HSImp.CUInt)))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Cursor_getObjCDeclQualifiers"
clang_Cursor_getObjCDeclQualifiers'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Cursor_isObjCOptional"
clang_Cursor_isObjCOptional'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Cursor_isVariadic"
clang_Cursor_isVariadic'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_Cursor_getCommentRange"
clang_Cursor_getCommentRange'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_Cursor_getRawCommentText"
clang_Cursor_getRawCommentText'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_Cursor_getBriefCommentText"
clang_Cursor_getBriefCommentText'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_Cursor_getParsedComment"
clang_Cursor_getParsedComment'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Cursor_getModule"
clang_Cursor_getModule'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_Module_getASTFile"
clang_Module_getASTFile'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_Module_getParent"
clang_Module_getParent'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_Module_getName"
clang_Module_getName'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_Module_getFullName"
clang_Module_getFullName'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_Module_getNumTopLevelHeaders"
clang_Module_getNumTopLevelHeaders'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt)))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_Module_getTopLevelHeader"
clang_Module_getTopLevelHeader'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ())))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_CXXMethod_isPureVirtual"
clang_CXXMethod_isPureVirtual'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_CXXMethod_isStatic"
clang_CXXMethod_isStatic'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_CXXMethod_isVirtual"
clang_CXXMethod_isVirtual'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getTemplateCursorKind"
clang_getTemplateCursorKind'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getSpecializedCursorTemplate"
clang_getSpecializedCursorTemplate'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getCursorReferenceNameRange"
clang_getCursorReferenceNameRange'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ())))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Comment_getKind"
clang_Comment_getKind'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Comment_getNumChildren"
clang_Comment_getNumChildren'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Comment_getChild"
clang_Comment_getChild'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_Comment_isWhitespace"
clang_Comment_isWhitespace'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_InlineContentComment_hasTrailingNewline"
clang_InlineContentComment_hasTrailingNewline'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_TextComment_getText"
clang_TextComment_getText'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_InlineCommandComment_getCommandName"
clang_InlineCommandComment_getCommandName'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_InlineCommandComment_getRenderKind"
clang_InlineCommandComment_getRenderKind'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_InlineCommandComment_getNumArgs"
clang_InlineCommandComment_getNumArgs'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_InlineCommandComment_getArgText"
clang_InlineCommandComment_getArgText'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_HTMLTagComment_getTagName"
clang_HTMLTagComment_getTagName'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_HTMLStartTagComment_isSelfClosing"
clang_HTMLStartTagComment_isSelfClosing'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_HTMLStartTag_getNumAttrs"
clang_HTMLStartTag_getNumAttrs'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_HTMLStartTag_getAttrName"
clang_HTMLStartTag_getAttrName'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_HTMLStartTag_getAttrValue"
clang_HTMLStartTag_getAttrValue'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_BlockCommandComment_getCommandName"
clang_BlockCommandComment_getCommandName'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_BlockCommandComment_getNumArgs"
clang_BlockCommandComment_getNumArgs'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_BlockCommandComment_getArgText"
clang_BlockCommandComment_getArgText'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_BlockCommandComment_getParagraph"
clang_BlockCommandComment_getParagraph'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_ParamCommandComment_getParamName"
clang_ParamCommandComment_getParamName'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_ParamCommandComment_isParamIndexValid"
clang_ParamCommandComment_isParamIndexValid'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_ParamCommandComment_getParamIndex"
clang_ParamCommandComment_getParamIndex'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_ParamCommandComment_isDirectionExplicit"
clang_ParamCommandComment_isDirectionExplicit'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_ParamCommandComment_getDirection"
clang_ParamCommandComment_getDirection'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_TParamCommandComment_getParamName"
clang_TParamCommandComment_getParamName'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_TParamCommandComment_isParamPositionValid"
clang_TParamCommandComment_isParamPositionValid'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_TParamCommandComment_getDepth"
clang_TParamCommandComment_getDepth'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_TParamCommandComment_getIndex"
clang_TParamCommandComment_getIndex'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO C2HSImp.CUInt)))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_VerbatimBlockLineComment_getText"
clang_VerbatimBlockLineComment_getText'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_VerbatimLineComment_getText"
clang_VerbatimLineComment_getText'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_HTMLTagComment_getAsString"
clang_HTMLTagComment_getAsString'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_FullComment_getAsHTML"
clang_FullComment_getAsHTML'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_FullComment_getAsXML"
clang_FullComment_getAsXML'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getTokenKind"
clang_getTokenKind'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getTokenSpelling"
clang_getTokenSpelling'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getTokenLocation"
clang_getTokenLocation'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__wrapped_clang_getTokenExtent"
clang_getTokenExtent'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_tokenize"
clang_tokenize'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (IO ())))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_annotateTokens"
clang_annotateTokens'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr ()) -> (IO ())))))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getCursorKindSpelling"
clang_getCursorKindSpelling'_ :: (C2HSImp.CInt -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getCompletionChunkKind"
clang_getCompletionChunkKind'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO C2HSImp.CInt)))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getCompletionChunkText"
clang_getCompletionChunkText'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getCompletionChunkCompletionString"
clang_getCompletionChunkCompletionString'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getNumCompletionChunks"
clang_getNumCompletionChunks'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getCompletionPriority"
clang_getCompletionPriority'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getCompletionAvailability"
clang_getCompletionAvailability'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getCompletionNumAnnotations"
clang_getCompletionNumAnnotations'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getCompletionAnnotation"
clang_getCompletionAnnotation'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getCompletionParent"
clang_getCompletionParent'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr C2HSImp.CInt) -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getCompletionBriefComment"
clang_getCompletionBriefComment'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h __c2hs_wrapped__clang_getCursorCompletionString"
clang_getCursorCompletionString'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_defaultCodeCompleteOptions"
defaultCodeCompleteOptions'_ :: (IO C2HSImp.CUInt)
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_disposeCodeCompleteResults"
clang_disposeCodeCompleteResults'_ :: ((C2HSImp.Ptr ()) -> (IO ()))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_codeCompleteAt"
clang_codeCompleteAt'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr C2HSImp.CChar) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ())))))))))
foreign import ccall safe "Clang/Internal/FFI.chs.h codeCompleteGetNumResults"
codeCompleteGetNumResults''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h codeCompleteGetResult"
codeCompleteGetResult''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CInt))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_sortCodeCompletionResults"
clang_sortCodeCompletionResults'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_codeCompleteGetNumDiagnostics"
clang_codeCompleteGetNumDiagnostics'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_codeCompleteGetDiagnostic"
clang_codeCompleteGetDiagnostic'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_codeCompleteGetContexts"
clang_codeCompleteGetContexts'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CULLong))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_codeCompleteGetContainerKind"
clang_codeCompleteGetContainerKind'_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (IO C2HSImp.CInt)))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_codeCompleteGetContainerUSR"
clang_codeCompleteGetContainerUSR'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_codeCompleteGetObjCSelector"
clang_codeCompleteGetObjCSelector'_ :: ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h wrapped_clang_getClangVersion"
clang_getClangVersion'_ :: (IO (C2HSImp.Ptr ()))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_toggleCrashRecovery"
toggleCrashRecovery''_ :: (C2HSImp.CUInt -> (IO ()))
foreign import ccall safe "Clang/Internal/FFI.chs.h freeInclusionList"
freeInclusionList''_ :: ((C2HSImp.Ptr ()) -> (IO ()))
foreign import ccall safe "Clang/Internal/FFI.chs.h getInclusions"
getInclusions''_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (IO ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_remap_dispose"
clang_remap_dispose'_ :: ((C2HSImp.Ptr ()) -> (IO ()))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getRemappings"
clang_getRemappings'_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (IO (C2HSImp.Ptr ())))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_getRemappingsFromFileList"
clang_getRemappingsFromFileList'_ :: ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (C2HSImp.CUInt -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_remap_getNumFiles"
clang_remap_getNumFiles'_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CUInt))
foreign import ccall safe "Clang/Internal/FFI.chs.h clang_remap_getFilenames"
clang_remap_getFilenames'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO ())))))