diff --git a/ClangSharp/Extensions/CXSourceRangeList.cs b/ClangSharp/Extensions/CXSourceRangeList.cs index 724b0d35..f2ef11ca 100644 --- a/ClangSharp/Extensions/CXSourceRangeList.cs +++ b/ClangSharp/Extensions/CXSourceRangeList.cs @@ -1,7 +1,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Runtime.CompilerServices; namespace ClangSharp { diff --git a/ClangSharp/Extensions/CXTranslationUnit.cs b/ClangSharp/Extensions/CXTranslationUnit.cs index 90078377..90b62fcb 100644 --- a/ClangSharp/Extensions/CXTranslationUnit.cs +++ b/ClangSharp/Extensions/CXTranslationUnit.cs @@ -1,5 +1,4 @@ using System; -using System.Runtime.CompilerServices; namespace ClangSharp { diff --git a/ClangSharp/Generated/CXAvailabilityKind.cs b/ClangSharp/Generated/CXAvailabilityKind.cs new file mode 100644 index 00000000..db5c59bb --- /dev/null +++ b/ClangSharp/Generated/CXAvailabilityKind.cs @@ -0,0 +1,10 @@ +namespace ClangSharp +{ + public enum CXAvailabilityKind + { + CXAvailability_Available = 0, + CXAvailability_Deprecated = 1, + CXAvailability_NotAvailable = 2, + CXAvailability_NotAccessible = 3, + } +} diff --git a/ClangSharp/Generated/CXCallingConv.cs b/ClangSharp/Generated/CXCallingConv.cs new file mode 100644 index 00000000..803b215e --- /dev/null +++ b/ClangSharp/Generated/CXCallingConv.cs @@ -0,0 +1,26 @@ +namespace ClangSharp +{ + public enum CXCallingConv + { + CXCallingConv_Default = 0, + CXCallingConv_C = 1, + CXCallingConv_X86StdCall = 2, + CXCallingConv_X86FastCall = 3, + CXCallingConv_X86ThisCall = 4, + CXCallingConv_X86Pascal = 5, + CXCallingConv_AAPCS = 6, + CXCallingConv_AAPCS_VFP = 7, + CXCallingConv_X86RegCall = 8, + CXCallingConv_IntelOclBicc = 9, + CXCallingConv_Win64 = 10, + CXCallingConv_X86_64Win64 = 10, + CXCallingConv_X86_64SysV = 11, + CXCallingConv_X86VectorCall = 12, + CXCallingConv_Swift = 13, + CXCallingConv_PreserveMost = 14, + CXCallingConv_PreserveAll = 15, + CXCallingConv_AArch64VectorCall = 16, + CXCallingConv_Invalid = 100, + CXCallingConv_Unexposed = 200, + } +} diff --git a/ClangSharp/Generated/CXChildVisitResult.cs b/ClangSharp/Generated/CXChildVisitResult.cs new file mode 100644 index 00000000..b4d571a6 --- /dev/null +++ b/ClangSharp/Generated/CXChildVisitResult.cs @@ -0,0 +1,9 @@ +namespace ClangSharp +{ + public enum CXChildVisitResult + { + CXChildVisit_Break = 0, + CXChildVisit_Continue = 1, + CXChildVisit_Recurse = 2, + } +} diff --git a/ClangSharp/Generated/CXClientData.cs b/ClangSharp/Generated/CXClientData.cs new file mode 100644 index 00000000..e33ad344 --- /dev/null +++ b/ClangSharp/Generated/CXClientData.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXClientData + { + public CXClientData(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXCodeCompleteResults.cs b/ClangSharp/Generated/CXCodeCompleteResults.cs new file mode 100644 index 00000000..628415d0 --- /dev/null +++ b/ClangSharp/Generated/CXCodeCompleteResults.cs @@ -0,0 +1,10 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXCodeCompleteResults + { + public IntPtr Results; + public uint NumResults; + } +} diff --git a/ClangSharp/Generated/CXCodeComplete_Flags.cs b/ClangSharp/Generated/CXCodeComplete_Flags.cs new file mode 100644 index 00000000..96d61a35 --- /dev/null +++ b/ClangSharp/Generated/CXCodeComplete_Flags.cs @@ -0,0 +1,11 @@ +namespace ClangSharp +{ + public enum CXCodeComplete_Flags + { + CXCodeComplete_IncludeMacros = 1, + CXCodeComplete_IncludeCodePatterns = 2, + CXCodeComplete_IncludeBriefComments = 4, + CXCodeComplete_SkipPreamble = 8, + CXCodeComplete_IncludeCompletionsWithFixIts = 16, + } +} diff --git a/ClangSharp/Generated/CXComment.cs b/ClangSharp/Generated/CXComment.cs new file mode 100644 index 00000000..b2689658 --- /dev/null +++ b/ClangSharp/Generated/CXComment.cs @@ -0,0 +1,10 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXComment + { + public IntPtr ASTNode; + public CXTranslationUnit TranslationUnit; + } +} diff --git a/ClangSharp/Generated/CXCommentInlineCommandRenderKind.cs b/ClangSharp/Generated/CXCommentInlineCommandRenderKind.cs new file mode 100644 index 00000000..5b93d877 --- /dev/null +++ b/ClangSharp/Generated/CXCommentInlineCommandRenderKind.cs @@ -0,0 +1,10 @@ +namespace ClangSharp +{ + public enum CXCommentInlineCommandRenderKind + { + CXCommentInlineCommandRenderKind_Normal = 0, + CXCommentInlineCommandRenderKind_Bold = 1, + CXCommentInlineCommandRenderKind_Monospaced = 2, + CXCommentInlineCommandRenderKind_Emphasized = 3, + } +} diff --git a/ClangSharp/Generated/CXCommentKind.cs b/ClangSharp/Generated/CXCommentKind.cs new file mode 100644 index 00000000..f07462dd --- /dev/null +++ b/ClangSharp/Generated/CXCommentKind.cs @@ -0,0 +1,19 @@ +namespace ClangSharp +{ + public enum CXCommentKind + { + CXComment_Null = 0, + CXComment_Text = 1, + CXComment_InlineCommand = 2, + CXComment_HTMLStartTag = 3, + CXComment_HTMLEndTag = 4, + CXComment_Paragraph = 5, + CXComment_BlockCommand = 6, + CXComment_ParamCommand = 7, + CXComment_TParamCommand = 8, + CXComment_VerbatimBlockCommand = 9, + CXComment_VerbatimBlockLine = 10, + CXComment_VerbatimLine = 11, + CXComment_FullComment = 12, + } +} diff --git a/ClangSharp/Generated/CXCommentParamPassDirection.cs b/ClangSharp/Generated/CXCommentParamPassDirection.cs new file mode 100644 index 00000000..10f14080 --- /dev/null +++ b/ClangSharp/Generated/CXCommentParamPassDirection.cs @@ -0,0 +1,9 @@ +namespace ClangSharp +{ + public enum CXCommentParamPassDirection + { + CXCommentParamPassDirection_In = 0, + CXCommentParamPassDirection_Out = 1, + CXCommentParamPassDirection_InOut = 2, + } +} diff --git a/ClangSharp/Generated/CXCompilationDatabase.cs b/ClangSharp/Generated/CXCompilationDatabase.cs new file mode 100644 index 00000000..1a5c871c --- /dev/null +++ b/ClangSharp/Generated/CXCompilationDatabase.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXCompilationDatabase + { + public CXCompilationDatabase(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXCompilationDatabase_Error.cs b/ClangSharp/Generated/CXCompilationDatabase_Error.cs new file mode 100644 index 00000000..889e9286 --- /dev/null +++ b/ClangSharp/Generated/CXCompilationDatabase_Error.cs @@ -0,0 +1,8 @@ +namespace ClangSharp +{ + public enum CXCompilationDatabase_Error + { + CXCompilationDatabase_NoError = 0, + CXCompilationDatabase_CanNotLoadDatabase = 1, + } +} diff --git a/ClangSharp/Generated/CXCompileCommand.cs b/ClangSharp/Generated/CXCompileCommand.cs new file mode 100644 index 00000000..b3f91c05 --- /dev/null +++ b/ClangSharp/Generated/CXCompileCommand.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXCompileCommand + { + public CXCompileCommand(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXCompileCommands.cs b/ClangSharp/Generated/CXCompileCommands.cs new file mode 100644 index 00000000..b7aed4d2 --- /dev/null +++ b/ClangSharp/Generated/CXCompileCommands.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXCompileCommands + { + public CXCompileCommands(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXCompletionChunkKind.cs b/ClangSharp/Generated/CXCompletionChunkKind.cs new file mode 100644 index 00000000..44de9ae8 --- /dev/null +++ b/ClangSharp/Generated/CXCompletionChunkKind.cs @@ -0,0 +1,27 @@ +namespace ClangSharp +{ + public enum CXCompletionChunkKind + { + CXCompletionChunk_Optional = 0, + CXCompletionChunk_TypedText = 1, + CXCompletionChunk_Text = 2, + CXCompletionChunk_Placeholder = 3, + CXCompletionChunk_Informative = 4, + CXCompletionChunk_CurrentParameter = 5, + CXCompletionChunk_LeftParen = 6, + CXCompletionChunk_RightParen = 7, + CXCompletionChunk_LeftBracket = 8, + CXCompletionChunk_RightBracket = 9, + CXCompletionChunk_LeftBrace = 10, + CXCompletionChunk_RightBrace = 11, + CXCompletionChunk_LeftAngle = 12, + CXCompletionChunk_RightAngle = 13, + CXCompletionChunk_Comma = 14, + CXCompletionChunk_ResultType = 15, + CXCompletionChunk_Colon = 16, + CXCompletionChunk_SemiColon = 17, + CXCompletionChunk_Equal = 18, + CXCompletionChunk_HorizontalSpace = 19, + CXCompletionChunk_VerticalSpace = 20, + } +} diff --git a/ClangSharp/Generated/CXCompletionContext.cs b/ClangSharp/Generated/CXCompletionContext.cs new file mode 100644 index 00000000..9a3907d5 --- /dev/null +++ b/ClangSharp/Generated/CXCompletionContext.cs @@ -0,0 +1,31 @@ +namespace ClangSharp +{ + public enum CXCompletionContext + { + CXCompletionContext_Unexposed = 0, + CXCompletionContext_AnyType = 1, + CXCompletionContext_AnyValue = 2, + CXCompletionContext_ObjCObjectValue = 4, + CXCompletionContext_ObjCSelectorValue = 8, + CXCompletionContext_CXXClassTypeValue = 16, + CXCompletionContext_DotMemberAccess = 32, + CXCompletionContext_ArrowMemberAccess = 64, + CXCompletionContext_ObjCPropertyAccess = 128, + CXCompletionContext_EnumTag = 256, + CXCompletionContext_UnionTag = 512, + CXCompletionContext_StructTag = 1024, + CXCompletionContext_ClassTag = 2048, + CXCompletionContext_Namespace = 4096, + CXCompletionContext_NestedNameSpecifier = 8192, + CXCompletionContext_ObjCInterface = 16384, + CXCompletionContext_ObjCProtocol = 32768, + CXCompletionContext_ObjCCategory = 65536, + CXCompletionContext_ObjCInstanceMessage = 131072, + CXCompletionContext_ObjCClassMessage = 262144, + CXCompletionContext_ObjCSelectorName = 524288, + CXCompletionContext_MacroName = 1048576, + CXCompletionContext_NaturalLanguage = 2097152, + CXCompletionContext_IncludedFile = 4194304, + CXCompletionContext_Unknown = 8388607, + } +} diff --git a/ClangSharp/Generated/CXCompletionResult.cs b/ClangSharp/Generated/CXCompletionResult.cs new file mode 100644 index 00000000..dd479c34 --- /dev/null +++ b/ClangSharp/Generated/CXCompletionResult.cs @@ -0,0 +1,8 @@ +namespace ClangSharp +{ + public partial struct CXCompletionResult + { + public CXCursorKind CursorKind; + public CXCompletionString CompletionString; + } +} diff --git a/ClangSharp/Generated/CXCompletionString.cs b/ClangSharp/Generated/CXCompletionString.cs new file mode 100644 index 00000000..143e0a48 --- /dev/null +++ b/ClangSharp/Generated/CXCompletionString.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXCompletionString + { + public CXCompletionString(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXCursor.cs b/ClangSharp/Generated/CXCursor.cs new file mode 100644 index 00000000..24b03125 --- /dev/null +++ b/ClangSharp/Generated/CXCursor.cs @@ -0,0 +1,11 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXCursor + { + public CXCursorKind kind; + public int xdata; + public IntPtr data0; public IntPtr data1; public IntPtr data2; + } +} diff --git a/ClangSharp/Generated/CXCursorAndRangeVisitor.cs b/ClangSharp/Generated/CXCursorAndRangeVisitor.cs new file mode 100644 index 00000000..302e87ee --- /dev/null +++ b/ClangSharp/Generated/CXCursorAndRangeVisitor.cs @@ -0,0 +1,10 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXCursorAndRangeVisitor + { + public IntPtr context; + public IntPtr visit; + } +} diff --git a/ClangSharp/Generated/CXCursorKind.cs b/ClangSharp/Generated/CXCursorKind.cs new file mode 100644 index 00000000..29652565 --- /dev/null +++ b/ClangSharp/Generated/CXCursorKind.cs @@ -0,0 +1,256 @@ +namespace ClangSharp +{ + public enum CXCursorKind + { + CXCursor_UnexposedDecl = 1, + CXCursor_StructDecl = 2, + CXCursor_UnionDecl = 3, + CXCursor_ClassDecl = 4, + CXCursor_EnumDecl = 5, + CXCursor_FieldDecl = 6, + CXCursor_EnumConstantDecl = 7, + CXCursor_FunctionDecl = 8, + CXCursor_VarDecl = 9, + CXCursor_ParmDecl = 10, + CXCursor_ObjCInterfaceDecl = 11, + CXCursor_ObjCCategoryDecl = 12, + CXCursor_ObjCProtocolDecl = 13, + CXCursor_ObjCPropertyDecl = 14, + CXCursor_ObjCIvarDecl = 15, + CXCursor_ObjCInstanceMethodDecl = 16, + CXCursor_ObjCClassMethodDecl = 17, + CXCursor_ObjCImplementationDecl = 18, + CXCursor_ObjCCategoryImplDecl = 19, + CXCursor_TypedefDecl = 20, + CXCursor_CXXMethod = 21, + CXCursor_Namespace = 22, + CXCursor_LinkageSpec = 23, + CXCursor_Constructor = 24, + CXCursor_Destructor = 25, + CXCursor_ConversionFunction = 26, + CXCursor_TemplateTypeParameter = 27, + CXCursor_NonTypeTemplateParameter = 28, + CXCursor_TemplateTemplateParameter = 29, + CXCursor_FunctionTemplate = 30, + CXCursor_ClassTemplate = 31, + CXCursor_ClassTemplatePartialSpecialization = 32, + CXCursor_NamespaceAlias = 33, + CXCursor_UsingDirective = 34, + CXCursor_UsingDeclaration = 35, + CXCursor_TypeAliasDecl = 36, + CXCursor_ObjCSynthesizeDecl = 37, + CXCursor_ObjCDynamicDecl = 38, + CXCursor_CXXAccessSpecifier = 39, + CXCursor_FirstDecl = 1, + CXCursor_LastDecl = 39, + CXCursor_FirstRef = 40, + CXCursor_ObjCSuperClassRef = 40, + CXCursor_ObjCProtocolRef = 41, + CXCursor_ObjCClassRef = 42, + CXCursor_TypeRef = 43, + CXCursor_CXXBaseSpecifier = 44, + CXCursor_TemplateRef = 45, + CXCursor_NamespaceRef = 46, + CXCursor_MemberRef = 47, + CXCursor_LabelRef = 48, + CXCursor_OverloadedDeclRef = 49, + CXCursor_VariableRef = 50, + CXCursor_LastRef = 50, + CXCursor_FirstInvalid = 70, + CXCursor_InvalidFile = 70, + CXCursor_NoDeclFound = 71, + CXCursor_NotImplemented = 72, + CXCursor_InvalidCode = 73, + CXCursor_LastInvalid = 73, + CXCursor_FirstExpr = 100, + CXCursor_UnexposedExpr = 100, + CXCursor_DeclRefExpr = 101, + CXCursor_MemberRefExpr = 102, + CXCursor_CallExpr = 103, + CXCursor_ObjCMessageExpr = 104, + CXCursor_BlockExpr = 105, + CXCursor_IntegerLiteral = 106, + CXCursor_FloatingLiteral = 107, + CXCursor_ImaginaryLiteral = 108, + CXCursor_StringLiteral = 109, + CXCursor_CharacterLiteral = 110, + CXCursor_ParenExpr = 111, + CXCursor_UnaryOperator = 112, + CXCursor_ArraySubscriptExpr = 113, + CXCursor_BinaryOperator = 114, + CXCursor_CompoundAssignOperator = 115, + CXCursor_ConditionalOperator = 116, + CXCursor_CStyleCastExpr = 117, + CXCursor_CompoundLiteralExpr = 118, + CXCursor_InitListExpr = 119, + CXCursor_AddrLabelExpr = 120, + CXCursor_StmtExpr = 121, + CXCursor_GenericSelectionExpr = 122, + CXCursor_GNUNullExpr = 123, + CXCursor_CXXStaticCastExpr = 124, + CXCursor_CXXDynamicCastExpr = 125, + CXCursor_CXXReinterpretCastExpr = 126, + CXCursor_CXXConstCastExpr = 127, + CXCursor_CXXFunctionalCastExpr = 128, + CXCursor_CXXTypeidExpr = 129, + CXCursor_CXXBoolLiteralExpr = 130, + CXCursor_CXXNullPtrLiteralExpr = 131, + CXCursor_CXXThisExpr = 132, + CXCursor_CXXThrowExpr = 133, + CXCursor_CXXNewExpr = 134, + CXCursor_CXXDeleteExpr = 135, + CXCursor_UnaryExpr = 136, + CXCursor_ObjCStringLiteral = 137, + CXCursor_ObjCEncodeExpr = 138, + CXCursor_ObjCSelectorExpr = 139, + CXCursor_ObjCProtocolExpr = 140, + CXCursor_ObjCBridgedCastExpr = 141, + CXCursor_PackExpansionExpr = 142, + CXCursor_SizeOfPackExpr = 143, + CXCursor_LambdaExpr = 144, + CXCursor_ObjCBoolLiteralExpr = 145, + CXCursor_ObjCSelfExpr = 146, + CXCursor_OMPArraySectionExpr = 147, + CXCursor_ObjCAvailabilityCheckExpr = 148, + CXCursor_FixedPointLiteral = 149, + CXCursor_LastExpr = 149, + CXCursor_FirstStmt = 200, + CXCursor_UnexposedStmt = 200, + CXCursor_LabelStmt = 201, + CXCursor_CompoundStmt = 202, + CXCursor_CaseStmt = 203, + CXCursor_DefaultStmt = 204, + CXCursor_IfStmt = 205, + CXCursor_SwitchStmt = 206, + CXCursor_WhileStmt = 207, + CXCursor_DoStmt = 208, + CXCursor_ForStmt = 209, + CXCursor_GotoStmt = 210, + CXCursor_IndirectGotoStmt = 211, + CXCursor_ContinueStmt = 212, + CXCursor_BreakStmt = 213, + CXCursor_ReturnStmt = 214, + CXCursor_GCCAsmStmt = 215, + CXCursor_AsmStmt = 215, + CXCursor_ObjCAtTryStmt = 216, + CXCursor_ObjCAtCatchStmt = 217, + CXCursor_ObjCAtFinallyStmt = 218, + CXCursor_ObjCAtThrowStmt = 219, + CXCursor_ObjCAtSynchronizedStmt = 220, + CXCursor_ObjCAutoreleasePoolStmt = 221, + CXCursor_ObjCForCollectionStmt = 222, + CXCursor_CXXCatchStmt = 223, + CXCursor_CXXTryStmt = 224, + CXCursor_CXXForRangeStmt = 225, + CXCursor_SEHTryStmt = 226, + CXCursor_SEHExceptStmt = 227, + CXCursor_SEHFinallyStmt = 228, + CXCursor_MSAsmStmt = 229, + CXCursor_NullStmt = 230, + CXCursor_DeclStmt = 231, + CXCursor_OMPParallelDirective = 232, + CXCursor_OMPSimdDirective = 233, + CXCursor_OMPForDirective = 234, + CXCursor_OMPSectionsDirective = 235, + CXCursor_OMPSectionDirective = 236, + CXCursor_OMPSingleDirective = 237, + CXCursor_OMPParallelForDirective = 238, + CXCursor_OMPParallelSectionsDirective = 239, + CXCursor_OMPTaskDirective = 240, + CXCursor_OMPMasterDirective = 241, + CXCursor_OMPCriticalDirective = 242, + CXCursor_OMPTaskyieldDirective = 243, + CXCursor_OMPBarrierDirective = 244, + CXCursor_OMPTaskwaitDirective = 245, + CXCursor_OMPFlushDirective = 246, + CXCursor_SEHLeaveStmt = 247, + CXCursor_OMPOrderedDirective = 248, + CXCursor_OMPAtomicDirective = 249, + CXCursor_OMPForSimdDirective = 250, + CXCursor_OMPParallelForSimdDirective = 251, + CXCursor_OMPTargetDirective = 252, + CXCursor_OMPTeamsDirective = 253, + CXCursor_OMPTaskgroupDirective = 254, + CXCursor_OMPCancellationPointDirective = 255, + CXCursor_OMPCancelDirective = 256, + CXCursor_OMPTargetDataDirective = 257, + CXCursor_OMPTaskLoopDirective = 258, + CXCursor_OMPTaskLoopSimdDirective = 259, + CXCursor_OMPDistributeDirective = 260, + CXCursor_OMPTargetEnterDataDirective = 261, + CXCursor_OMPTargetExitDataDirective = 262, + CXCursor_OMPTargetParallelDirective = 263, + CXCursor_OMPTargetParallelForDirective = 264, + CXCursor_OMPTargetUpdateDirective = 265, + CXCursor_OMPDistributeParallelForDirective = 266, + CXCursor_OMPDistributeParallelForSimdDirective = 267, + CXCursor_OMPDistributeSimdDirective = 268, + CXCursor_OMPTargetParallelForSimdDirective = 269, + CXCursor_OMPTargetSimdDirective = 270, + CXCursor_OMPTeamsDistributeDirective = 271, + CXCursor_OMPTeamsDistributeSimdDirective = 272, + CXCursor_OMPTeamsDistributeParallelForSimdDirective = 273, + CXCursor_OMPTeamsDistributeParallelForDirective = 274, + CXCursor_OMPTargetTeamsDirective = 275, + CXCursor_OMPTargetTeamsDistributeDirective = 276, + CXCursor_OMPTargetTeamsDistributeParallelForDirective = 277, + CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective = 278, + CXCursor_OMPTargetTeamsDistributeSimdDirective = 279, + CXCursor_LastStmt = 279, + CXCursor_TranslationUnit = 300, + CXCursor_FirstAttr = 400, + CXCursor_UnexposedAttr = 400, + CXCursor_IBActionAttr = 401, + CXCursor_IBOutletAttr = 402, + CXCursor_IBOutletCollectionAttr = 403, + CXCursor_CXXFinalAttr = 404, + CXCursor_CXXOverrideAttr = 405, + CXCursor_AnnotateAttr = 406, + CXCursor_AsmLabelAttr = 407, + CXCursor_PackedAttr = 408, + CXCursor_PureAttr = 409, + CXCursor_ConstAttr = 410, + CXCursor_NoDuplicateAttr = 411, + CXCursor_CUDAConstantAttr = 412, + CXCursor_CUDADeviceAttr = 413, + CXCursor_CUDAGlobalAttr = 414, + CXCursor_CUDAHostAttr = 415, + CXCursor_CUDASharedAttr = 416, + CXCursor_VisibilityAttr = 417, + CXCursor_DLLExport = 418, + CXCursor_DLLImport = 419, + CXCursor_NSReturnsRetained = 420, + CXCursor_NSReturnsNotRetained = 421, + CXCursor_NSReturnsAutoreleased = 422, + CXCursor_NSConsumesSelf = 423, + CXCursor_NSConsumed = 424, + CXCursor_ObjCException = 425, + CXCursor_ObjCNSObject = 426, + CXCursor_ObjCIndependentClass = 427, + CXCursor_ObjCPreciseLifetime = 428, + CXCursor_ObjCReturnsInnerPointer = 429, + CXCursor_ObjCRequiresSuper = 430, + CXCursor_ObjCRootClass = 431, + CXCursor_ObjCSubclassingRestricted = 432, + CXCursor_ObjCExplicitProtocolImpl = 433, + CXCursor_ObjCDesignatedInitializer = 434, + CXCursor_ObjCRuntimeVisible = 435, + CXCursor_ObjCBoxable = 436, + CXCursor_FlagEnum = 437, + CXCursor_LastAttr = 437, + CXCursor_PreprocessingDirective = 500, + CXCursor_MacroDefinition = 501, + CXCursor_MacroExpansion = 502, + CXCursor_MacroInstantiation = 502, + CXCursor_InclusionDirective = 503, + CXCursor_FirstPreprocessing = 500, + CXCursor_LastPreprocessing = 503, + CXCursor_ModuleImportDecl = 600, + CXCursor_TypeAliasTemplateDecl = 601, + CXCursor_StaticAssert = 602, + CXCursor_FriendDecl = 603, + CXCursor_FirstExtraDecl = 600, + CXCursor_LastExtraDecl = 603, + CXCursor_OverloadCandidate = 700, + } +} diff --git a/ClangSharp/Generated/CXCursorSet.cs b/ClangSharp/Generated/CXCursorSet.cs new file mode 100644 index 00000000..4142c51a --- /dev/null +++ b/ClangSharp/Generated/CXCursorSet.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXCursorSet + { + public CXCursorSet(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXCursorSetImpl.cs b/ClangSharp/Generated/CXCursorSetImpl.cs new file mode 100644 index 00000000..4f0faa51 --- /dev/null +++ b/ClangSharp/Generated/CXCursorSetImpl.cs @@ -0,0 +1,6 @@ +namespace ClangSharp +{ + public partial struct CXCursorSetImpl + { + } +} diff --git a/ClangSharp/Generated/CXCursorVisitor.cs b/ClangSharp/Generated/CXCursorVisitor.cs new file mode 100644 index 00000000..29bd0fe6 --- /dev/null +++ b/ClangSharp/Generated/CXCursorVisitor.cs @@ -0,0 +1,7 @@ +using System.Runtime.InteropServices; + +namespace ClangSharp +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate CXChildVisitResult CXCursorVisitor(CXCursor cursor, CXCursor parent, CXClientData client_data); +} diff --git a/ClangSharp/Generated/CXCursor_ExceptionSpecificationKind.cs b/ClangSharp/Generated/CXCursor_ExceptionSpecificationKind.cs new file mode 100644 index 00000000..01579292 --- /dev/null +++ b/ClangSharp/Generated/CXCursor_ExceptionSpecificationKind.cs @@ -0,0 +1,15 @@ +namespace ClangSharp +{ + public enum CXCursor_ExceptionSpecificationKind + { + CXCursor_ExceptionSpecificationKind_None = 0, + CXCursor_ExceptionSpecificationKind_DynamicNone = 1, + CXCursor_ExceptionSpecificationKind_Dynamic = 2, + CXCursor_ExceptionSpecificationKind_MSAny = 3, + CXCursor_ExceptionSpecificationKind_BasicNoexcept = 4, + CXCursor_ExceptionSpecificationKind_ComputedNoexcept = 5, + CXCursor_ExceptionSpecificationKind_Unevaluated = 6, + CXCursor_ExceptionSpecificationKind_Uninstantiated = 7, + CXCursor_ExceptionSpecificationKind_Unparsed = 8, + } +} diff --git a/ClangSharp/Generated/CXDiagnostic.cs b/ClangSharp/Generated/CXDiagnostic.cs new file mode 100644 index 00000000..fbefa0ad --- /dev/null +++ b/ClangSharp/Generated/CXDiagnostic.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXDiagnostic + { + public CXDiagnostic(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXDiagnosticDisplayOptions.cs b/ClangSharp/Generated/CXDiagnosticDisplayOptions.cs new file mode 100644 index 00000000..d1186da1 --- /dev/null +++ b/ClangSharp/Generated/CXDiagnosticDisplayOptions.cs @@ -0,0 +1,12 @@ +namespace ClangSharp +{ + public enum CXDiagnosticDisplayOptions + { + CXDiagnostic_DisplaySourceLocation = 1, + CXDiagnostic_DisplayColumn = 2, + CXDiagnostic_DisplaySourceRanges = 4, + CXDiagnostic_DisplayOption = 8, + CXDiagnostic_DisplayCategoryId = 16, + CXDiagnostic_DisplayCategoryName = 32, + } +} diff --git a/ClangSharp/Generated/CXDiagnosticSet.cs b/ClangSharp/Generated/CXDiagnosticSet.cs new file mode 100644 index 00000000..0bc58c2f --- /dev/null +++ b/ClangSharp/Generated/CXDiagnosticSet.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXDiagnosticSet + { + public CXDiagnosticSet(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXDiagnosticSeverity.cs b/ClangSharp/Generated/CXDiagnosticSeverity.cs new file mode 100644 index 00000000..66a4a90e --- /dev/null +++ b/ClangSharp/Generated/CXDiagnosticSeverity.cs @@ -0,0 +1,11 @@ +namespace ClangSharp +{ + public enum CXDiagnosticSeverity + { + CXDiagnostic_Ignored = 0, + CXDiagnostic_Note = 1, + CXDiagnostic_Warning = 2, + CXDiagnostic_Error = 3, + CXDiagnostic_Fatal = 4, + } +} diff --git a/ClangSharp/Generated/CXErrorCode.cs b/ClangSharp/Generated/CXErrorCode.cs new file mode 100644 index 00000000..1b43f5f9 --- /dev/null +++ b/ClangSharp/Generated/CXErrorCode.cs @@ -0,0 +1,11 @@ +namespace ClangSharp +{ + public enum CXErrorCode + { + CXError_Success = 0, + CXError_Failure = 1, + CXError_Crashed = 2, + CXError_InvalidArguments = 3, + CXError_ASTReadError = 4, + } +} diff --git a/ClangSharp/Generated/CXEvalResult.cs b/ClangSharp/Generated/CXEvalResult.cs new file mode 100644 index 00000000..15f6172a --- /dev/null +++ b/ClangSharp/Generated/CXEvalResult.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXEvalResult + { + public CXEvalResult(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXEvalResultKind.cs b/ClangSharp/Generated/CXEvalResultKind.cs new file mode 100644 index 00000000..a25ed3d7 --- /dev/null +++ b/ClangSharp/Generated/CXEvalResultKind.cs @@ -0,0 +1,13 @@ +namespace ClangSharp +{ + public enum CXEvalResultKind + { + CXEval_Int = 1, + CXEval_Float = 2, + CXEval_ObjCStrLiteral = 3, + CXEval_StrLiteral = 4, + CXEval_CFStr = 5, + CXEval_Other = 6, + CXEval_UnExposed = 0, + } +} diff --git a/ClangSharp/Generated/CXFieldVisitor.cs b/ClangSharp/Generated/CXFieldVisitor.cs new file mode 100644 index 00000000..567e133e --- /dev/null +++ b/ClangSharp/Generated/CXFieldVisitor.cs @@ -0,0 +1,7 @@ +using System.Runtime.InteropServices; + +namespace ClangSharp +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate CXVisitorResult CXFieldVisitor(CXCursor C, CXClientData client_data); +} diff --git a/ClangSharp/Generated/CXFile.cs b/ClangSharp/Generated/CXFile.cs new file mode 100644 index 00000000..3f29021e --- /dev/null +++ b/ClangSharp/Generated/CXFile.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXFile + { + public CXFile(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXFileUniqueID.cs b/ClangSharp/Generated/CXFileUniqueID.cs new file mode 100644 index 00000000..5d692596 --- /dev/null +++ b/ClangSharp/Generated/CXFileUniqueID.cs @@ -0,0 +1,7 @@ +namespace ClangSharp +{ + public partial struct CXFileUniqueID + { + public ulong data0; public ulong data1; public ulong data2; + } +} diff --git a/ClangSharp/Generated/CXGlobalOptFlags.cs b/ClangSharp/Generated/CXGlobalOptFlags.cs new file mode 100644 index 00000000..acc69e99 --- /dev/null +++ b/ClangSharp/Generated/CXGlobalOptFlags.cs @@ -0,0 +1,10 @@ +namespace ClangSharp +{ + public enum CXGlobalOptFlags + { + CXGlobalOpt_None = 0, + CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 1, + CXGlobalOpt_ThreadBackgroundPriorityForEditing = 2, + CXGlobalOpt_ThreadBackgroundPriorityForAll = 3, + } +} diff --git a/ClangSharp/Generated/CXIdxAttrInfo.cs b/ClangSharp/Generated/CXIdxAttrInfo.cs new file mode 100644 index 00000000..7a9e242c --- /dev/null +++ b/ClangSharp/Generated/CXIdxAttrInfo.cs @@ -0,0 +1,9 @@ +namespace ClangSharp +{ + public partial struct CXIdxAttrInfo + { + public CXIdxAttrKind kind; + public CXCursor cursor; + public CXIdxLoc loc; + } +} diff --git a/ClangSharp/Generated/CXIdxAttrKind.cs b/ClangSharp/Generated/CXIdxAttrKind.cs new file mode 100644 index 00000000..e70f9143 --- /dev/null +++ b/ClangSharp/Generated/CXIdxAttrKind.cs @@ -0,0 +1,10 @@ +namespace ClangSharp +{ + public enum CXIdxAttrKind + { + CXIdxAttr_Unexposed = 0, + CXIdxAttr_IBAction = 1, + CXIdxAttr_IBOutlet = 2, + CXIdxAttr_IBOutletCollection = 3, + } +} diff --git a/ClangSharp/Generated/CXIdxBaseClassInfo.cs b/ClangSharp/Generated/CXIdxBaseClassInfo.cs new file mode 100644 index 00000000..f0c7b5c4 --- /dev/null +++ b/ClangSharp/Generated/CXIdxBaseClassInfo.cs @@ -0,0 +1,11 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIdxBaseClassInfo + { + public IntPtr @base; + public CXCursor cursor; + public CXIdxLoc loc; + } +} diff --git a/ClangSharp/Generated/CXIdxCXXClassDeclInfo.cs b/ClangSharp/Generated/CXIdxCXXClassDeclInfo.cs new file mode 100644 index 00000000..d6b74f2b --- /dev/null +++ b/ClangSharp/Generated/CXIdxCXXClassDeclInfo.cs @@ -0,0 +1,11 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIdxCXXClassDeclInfo + { + public IntPtr declInfo; + public IntPtr bases; + public uint numBases; + } +} diff --git a/ClangSharp/Generated/CXIdxClientASTFile.cs b/ClangSharp/Generated/CXIdxClientASTFile.cs new file mode 100644 index 00000000..2cd997e7 --- /dev/null +++ b/ClangSharp/Generated/CXIdxClientASTFile.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIdxClientASTFile + { + public CXIdxClientASTFile(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXIdxClientContainer.cs b/ClangSharp/Generated/CXIdxClientContainer.cs new file mode 100644 index 00000000..ccd428c7 --- /dev/null +++ b/ClangSharp/Generated/CXIdxClientContainer.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIdxClientContainer + { + public CXIdxClientContainer(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXIdxClientEntity.cs b/ClangSharp/Generated/CXIdxClientEntity.cs new file mode 100644 index 00000000..47db3afa --- /dev/null +++ b/ClangSharp/Generated/CXIdxClientEntity.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIdxClientEntity + { + public CXIdxClientEntity(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXIdxClientFile.cs b/ClangSharp/Generated/CXIdxClientFile.cs new file mode 100644 index 00000000..046cbd12 --- /dev/null +++ b/ClangSharp/Generated/CXIdxClientFile.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIdxClientFile + { + public CXIdxClientFile(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXIdxContainerInfo.cs b/ClangSharp/Generated/CXIdxContainerInfo.cs new file mode 100644 index 00000000..2a80b65e --- /dev/null +++ b/ClangSharp/Generated/CXIdxContainerInfo.cs @@ -0,0 +1,7 @@ +namespace ClangSharp +{ + public partial struct CXIdxContainerInfo + { + public CXCursor cursor; + } +} diff --git a/ClangSharp/Generated/CXIdxDeclInfo.cs b/ClangSharp/Generated/CXIdxDeclInfo.cs new file mode 100644 index 00000000..31c1f173 --- /dev/null +++ b/ClangSharp/Generated/CXIdxDeclInfo.cs @@ -0,0 +1,21 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIdxDeclInfo + { + public IntPtr entityInfo; + public CXCursor cursor; + public CXIdxLoc loc; + public IntPtr semanticContainer; + public IntPtr lexicalContainer; + public int isRedeclaration; + public int isDefinition; + public int isContainer; + public IntPtr declAsContainer; + public int isImplicit; + public IntPtr attributes; + public uint numAttributes; + public uint flags; + } +} diff --git a/ClangSharp/Generated/CXIdxDeclInfoFlags.cs b/ClangSharp/Generated/CXIdxDeclInfoFlags.cs new file mode 100644 index 00000000..2b14d08a --- /dev/null +++ b/ClangSharp/Generated/CXIdxDeclInfoFlags.cs @@ -0,0 +1,7 @@ +namespace ClangSharp +{ + public enum CXIdxDeclInfoFlags + { + CXIdxDeclFlag_Skipped = 1, + } +} diff --git a/ClangSharp/Generated/CXIdxEntityCXXTemplateKind.cs b/ClangSharp/Generated/CXIdxEntityCXXTemplateKind.cs new file mode 100644 index 00000000..4ab9c634 --- /dev/null +++ b/ClangSharp/Generated/CXIdxEntityCXXTemplateKind.cs @@ -0,0 +1,10 @@ +namespace ClangSharp +{ + public enum CXIdxEntityCXXTemplateKind + { + CXIdxEntity_NonTemplate = 0, + CXIdxEntity_Template = 1, + CXIdxEntity_TemplatePartialSpecialization = 2, + CXIdxEntity_TemplateSpecialization = 3, + } +} diff --git a/ClangSharp/Generated/CXIdxEntityInfo.cs b/ClangSharp/Generated/CXIdxEntityInfo.cs new file mode 100644 index 00000000..cde84f71 --- /dev/null +++ b/ClangSharp/Generated/CXIdxEntityInfo.cs @@ -0,0 +1,17 @@ +using System; +using System.Runtime.InteropServices; + +namespace ClangSharp +{ + public partial struct CXIdxEntityInfo + { + public CXIdxEntityKind kind; + public CXIdxEntityCXXTemplateKind templateKind; + public CXIdxEntityLanguage lang; + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(StringMarshaler))] public string name; + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(StringMarshaler))] public string USR; + public CXCursor cursor; + public IntPtr attributes; + public uint numAttributes; + } +} diff --git a/ClangSharp/Generated/CXIdxEntityKind.cs b/ClangSharp/Generated/CXIdxEntityKind.cs new file mode 100644 index 00000000..34508f5a --- /dev/null +++ b/ClangSharp/Generated/CXIdxEntityKind.cs @@ -0,0 +1,33 @@ +namespace ClangSharp +{ + public enum CXIdxEntityKind + { + CXIdxEntity_Unexposed = 0, + CXIdxEntity_Typedef = 1, + CXIdxEntity_Function = 2, + CXIdxEntity_Variable = 3, + CXIdxEntity_Field = 4, + CXIdxEntity_EnumConstant = 5, + CXIdxEntity_ObjCClass = 6, + CXIdxEntity_ObjCProtocol = 7, + CXIdxEntity_ObjCCategory = 8, + CXIdxEntity_ObjCInstanceMethod = 9, + CXIdxEntity_ObjCClassMethod = 10, + CXIdxEntity_ObjCProperty = 11, + CXIdxEntity_ObjCIvar = 12, + CXIdxEntity_Enum = 13, + CXIdxEntity_Struct = 14, + CXIdxEntity_Union = 15, + CXIdxEntity_CXXClass = 16, + CXIdxEntity_CXXNamespace = 17, + CXIdxEntity_CXXNamespaceAlias = 18, + CXIdxEntity_CXXStaticVariable = 19, + CXIdxEntity_CXXStaticMethod = 20, + CXIdxEntity_CXXInstanceMethod = 21, + CXIdxEntity_CXXConstructor = 22, + CXIdxEntity_CXXDestructor = 23, + CXIdxEntity_CXXConversionFunction = 24, + CXIdxEntity_CXXTypeAlias = 25, + CXIdxEntity_CXXInterface = 26, + } +} diff --git a/ClangSharp/Generated/CXIdxEntityLanguage.cs b/ClangSharp/Generated/CXIdxEntityLanguage.cs new file mode 100644 index 00000000..7630caab --- /dev/null +++ b/ClangSharp/Generated/CXIdxEntityLanguage.cs @@ -0,0 +1,11 @@ +namespace ClangSharp +{ + public enum CXIdxEntityLanguage + { + CXIdxEntityLang_None = 0, + CXIdxEntityLang_C = 1, + CXIdxEntityLang_ObjC = 2, + CXIdxEntityLang_CXX = 3, + CXIdxEntityLang_Swift = 4, + } +} diff --git a/ClangSharp/Generated/CXIdxEntityRefInfo.cs b/ClangSharp/Generated/CXIdxEntityRefInfo.cs new file mode 100644 index 00000000..f2b2d90f --- /dev/null +++ b/ClangSharp/Generated/CXIdxEntityRefInfo.cs @@ -0,0 +1,15 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIdxEntityRefInfo + { + public CXIdxEntityRefKind kind; + public CXCursor cursor; + public CXIdxLoc loc; + public IntPtr referencedEntity; + public IntPtr parentEntity; + public IntPtr container; + public CXSymbolRole role; + } +} diff --git a/ClangSharp/Generated/CXIdxEntityRefKind.cs b/ClangSharp/Generated/CXIdxEntityRefKind.cs new file mode 100644 index 00000000..d3215512 --- /dev/null +++ b/ClangSharp/Generated/CXIdxEntityRefKind.cs @@ -0,0 +1,8 @@ +namespace ClangSharp +{ + public enum CXIdxEntityRefKind + { + CXIdxEntityRef_Direct = 1, + CXIdxEntityRef_Implicit = 2, + } +} diff --git a/ClangSharp/Generated/CXIdxIBOutletCollectionAttrInfo.cs b/ClangSharp/Generated/CXIdxIBOutletCollectionAttrInfo.cs new file mode 100644 index 00000000..49dda95d --- /dev/null +++ b/ClangSharp/Generated/CXIdxIBOutletCollectionAttrInfo.cs @@ -0,0 +1,12 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIdxIBOutletCollectionAttrInfo + { + public IntPtr attrInfo; + public IntPtr objcClass; + public CXCursor classCursor; + public CXIdxLoc classLoc; + } +} diff --git a/ClangSharp/Generated/CXIdxImportedASTFileInfo.cs b/ClangSharp/Generated/CXIdxImportedASTFileInfo.cs new file mode 100644 index 00000000..0930a3b2 --- /dev/null +++ b/ClangSharp/Generated/CXIdxImportedASTFileInfo.cs @@ -0,0 +1,10 @@ +namespace ClangSharp +{ + public partial struct CXIdxImportedASTFileInfo + { + public CXFile file; + public CXModule module; + public CXIdxLoc loc; + public int isImplicit; + } +} diff --git a/ClangSharp/Generated/CXIdxIncludedFileInfo.cs b/ClangSharp/Generated/CXIdxIncludedFileInfo.cs new file mode 100644 index 00000000..d5d464bc --- /dev/null +++ b/ClangSharp/Generated/CXIdxIncludedFileInfo.cs @@ -0,0 +1,14 @@ +using System.Runtime.InteropServices; + +namespace ClangSharp +{ + public partial struct CXIdxIncludedFileInfo + { + public CXIdxLoc hashLoc; + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(StringMarshaler))] public string filename; + public CXFile file; + public int isImport; + public int isAngled; + public int isModuleImport; + } +} diff --git a/ClangSharp/Generated/CXIdxLoc.cs b/ClangSharp/Generated/CXIdxLoc.cs new file mode 100644 index 00000000..544c37e2 --- /dev/null +++ b/ClangSharp/Generated/CXIdxLoc.cs @@ -0,0 +1,10 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIdxLoc + { + public IntPtr ptr_data0; public IntPtr ptr_data1; + public uint int_data; + } +} diff --git a/ClangSharp/Generated/CXIdxObjCCategoryDeclInfo.cs b/ClangSharp/Generated/CXIdxObjCCategoryDeclInfo.cs new file mode 100644 index 00000000..ce8075a6 --- /dev/null +++ b/ClangSharp/Generated/CXIdxObjCCategoryDeclInfo.cs @@ -0,0 +1,13 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIdxObjCCategoryDeclInfo + { + public IntPtr containerInfo; + public IntPtr objcClass; + public CXCursor classCursor; + public CXIdxLoc classLoc; + public IntPtr protocols; + } +} diff --git a/ClangSharp/Generated/CXIdxObjCContainerDeclInfo.cs b/ClangSharp/Generated/CXIdxObjCContainerDeclInfo.cs new file mode 100644 index 00000000..65107e0c --- /dev/null +++ b/ClangSharp/Generated/CXIdxObjCContainerDeclInfo.cs @@ -0,0 +1,10 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIdxObjCContainerDeclInfo + { + public IntPtr declInfo; + public CXIdxObjCContainerKind kind; + } +} diff --git a/ClangSharp/Generated/CXIdxObjCContainerKind.cs b/ClangSharp/Generated/CXIdxObjCContainerKind.cs new file mode 100644 index 00000000..c6669770 --- /dev/null +++ b/ClangSharp/Generated/CXIdxObjCContainerKind.cs @@ -0,0 +1,9 @@ +namespace ClangSharp +{ + public enum CXIdxObjCContainerKind + { + CXIdxObjCContainer_ForwardRef = 0, + CXIdxObjCContainer_Interface = 1, + CXIdxObjCContainer_Implementation = 2, + } +} diff --git a/ClangSharp/Generated/CXIdxObjCInterfaceDeclInfo.cs b/ClangSharp/Generated/CXIdxObjCInterfaceDeclInfo.cs new file mode 100644 index 00000000..374549ae --- /dev/null +++ b/ClangSharp/Generated/CXIdxObjCInterfaceDeclInfo.cs @@ -0,0 +1,11 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIdxObjCInterfaceDeclInfo + { + public IntPtr containerInfo; + public IntPtr superInfo; + public IntPtr protocols; + } +} diff --git a/ClangSharp/Generated/CXIdxObjCPropertyDeclInfo.cs b/ClangSharp/Generated/CXIdxObjCPropertyDeclInfo.cs new file mode 100644 index 00000000..7aec38ee --- /dev/null +++ b/ClangSharp/Generated/CXIdxObjCPropertyDeclInfo.cs @@ -0,0 +1,11 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIdxObjCPropertyDeclInfo + { + public IntPtr declInfo; + public IntPtr getter; + public IntPtr setter; + } +} diff --git a/ClangSharp/Generated/CXIdxObjCProtocolRefInfo.cs b/ClangSharp/Generated/CXIdxObjCProtocolRefInfo.cs new file mode 100644 index 00000000..a7d6396c --- /dev/null +++ b/ClangSharp/Generated/CXIdxObjCProtocolRefInfo.cs @@ -0,0 +1,11 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIdxObjCProtocolRefInfo + { + public IntPtr protocol; + public CXCursor cursor; + public CXIdxLoc loc; + } +} diff --git a/ClangSharp/Generated/CXIdxObjCProtocolRefListInfo.cs b/ClangSharp/Generated/CXIdxObjCProtocolRefListInfo.cs new file mode 100644 index 00000000..73c518a1 --- /dev/null +++ b/ClangSharp/Generated/CXIdxObjCProtocolRefListInfo.cs @@ -0,0 +1,10 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIdxObjCProtocolRefListInfo + { + public IntPtr protocols; + public uint numProtocols; + } +} diff --git a/ClangSharp/Generated/CXInclusionVisitor.cs b/ClangSharp/Generated/CXInclusionVisitor.cs new file mode 100644 index 00000000..f7824f45 --- /dev/null +++ b/ClangSharp/Generated/CXInclusionVisitor.cs @@ -0,0 +1,7 @@ +using System.Runtime.InteropServices; + +namespace ClangSharp +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void CXInclusionVisitor(CXFile included_file, out CXSourceLocation inclusion_stack, uint include_len, CXClientData client_data); +} diff --git a/ClangSharp/Generated/CXIndex.cs b/ClangSharp/Generated/CXIndex.cs new file mode 100644 index 00000000..ccef396c --- /dev/null +++ b/ClangSharp/Generated/CXIndex.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIndex + { + public CXIndex(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXIndexAction.cs b/ClangSharp/Generated/CXIndexAction.cs new file mode 100644 index 00000000..6c2db6be --- /dev/null +++ b/ClangSharp/Generated/CXIndexAction.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXIndexAction + { + public CXIndexAction(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXIndexOptFlags.cs b/ClangSharp/Generated/CXIndexOptFlags.cs new file mode 100644 index 00000000..160e2aac --- /dev/null +++ b/ClangSharp/Generated/CXIndexOptFlags.cs @@ -0,0 +1,12 @@ +namespace ClangSharp +{ + public enum CXIndexOptFlags + { + CXIndexOpt_None = 0, + CXIndexOpt_SuppressRedundantRefs = 1, + CXIndexOpt_IndexFunctionLocalSymbols = 2, + CXIndexOpt_IndexImplicitTemplateInstantiations = 4, + CXIndexOpt_SuppressWarnings = 8, + CXIndexOpt_SkipParsedBodiesInSession = 16, + } +} diff --git a/ClangSharp/Generated/CXLanguageKind.cs b/ClangSharp/Generated/CXLanguageKind.cs new file mode 100644 index 00000000..8bf783c8 --- /dev/null +++ b/ClangSharp/Generated/CXLanguageKind.cs @@ -0,0 +1,10 @@ +namespace ClangSharp +{ + public enum CXLanguageKind + { + CXLanguage_Invalid = 0, + CXLanguage_C = 1, + CXLanguage_ObjC = 2, + CXLanguage_CPlusPlus = 3, + } +} diff --git a/ClangSharp/Generated/CXLinkageKind.cs b/ClangSharp/Generated/CXLinkageKind.cs new file mode 100644 index 00000000..a9b5e52c --- /dev/null +++ b/ClangSharp/Generated/CXLinkageKind.cs @@ -0,0 +1,11 @@ +namespace ClangSharp +{ + public enum CXLinkageKind + { + CXLinkage_Invalid = 0, + CXLinkage_NoLinkage = 1, + CXLinkage_Internal = 2, + CXLinkage_UniqueExternal = 3, + CXLinkage_External = 4, + } +} diff --git a/ClangSharp/Generated/CXLoadDiag_Error.cs b/ClangSharp/Generated/CXLoadDiag_Error.cs new file mode 100644 index 00000000..80801c88 --- /dev/null +++ b/ClangSharp/Generated/CXLoadDiag_Error.cs @@ -0,0 +1,10 @@ +namespace ClangSharp +{ + public enum CXLoadDiag_Error + { + CXLoadDiag_None = 0, + CXLoadDiag_Unknown = 1, + CXLoadDiag_CannotLoad = 2, + CXLoadDiag_InvalidFile = 3, + } +} diff --git a/ClangSharp/Generated/CXModule.cs b/ClangSharp/Generated/CXModule.cs new file mode 100644 index 00000000..b4555500 --- /dev/null +++ b/ClangSharp/Generated/CXModule.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXModule + { + public CXModule(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXModuleMapDescriptor.cs b/ClangSharp/Generated/CXModuleMapDescriptor.cs new file mode 100644 index 00000000..9eeaf66f --- /dev/null +++ b/ClangSharp/Generated/CXModuleMapDescriptor.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXModuleMapDescriptor + { + public CXModuleMapDescriptor(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXModuleMapDescriptorImpl.cs b/ClangSharp/Generated/CXModuleMapDescriptorImpl.cs new file mode 100644 index 00000000..763c07bd --- /dev/null +++ b/ClangSharp/Generated/CXModuleMapDescriptorImpl.cs @@ -0,0 +1,6 @@ +namespace ClangSharp +{ + public partial struct CXModuleMapDescriptorImpl + { + } +} diff --git a/ClangSharp/Generated/CXNameRefFlags.cs b/ClangSharp/Generated/CXNameRefFlags.cs new file mode 100644 index 00000000..3eb776c2 --- /dev/null +++ b/ClangSharp/Generated/CXNameRefFlags.cs @@ -0,0 +1,9 @@ +namespace ClangSharp +{ + public enum CXNameRefFlags + { + CXNameRange_WantQualifier = 1, + CXNameRange_WantTemplateArgs = 2, + CXNameRange_WantSinglePiece = 4, + } +} diff --git a/ClangSharp/Generated/CXObjCDeclQualifierKind.cs b/ClangSharp/Generated/CXObjCDeclQualifierKind.cs new file mode 100644 index 00000000..7005a6ca --- /dev/null +++ b/ClangSharp/Generated/CXObjCDeclQualifierKind.cs @@ -0,0 +1,13 @@ +namespace ClangSharp +{ + public enum CXObjCDeclQualifierKind + { + CXObjCDeclQualifier_None = 0, + CXObjCDeclQualifier_In = 1, + CXObjCDeclQualifier_Inout = 2, + CXObjCDeclQualifier_Out = 4, + CXObjCDeclQualifier_Bycopy = 8, + CXObjCDeclQualifier_Byref = 16, + CXObjCDeclQualifier_Oneway = 32, + } +} diff --git a/ClangSharp/Generated/CXObjCPropertyAttrKind.cs b/ClangSharp/Generated/CXObjCPropertyAttrKind.cs new file mode 100644 index 00000000..72ce1d2e --- /dev/null +++ b/ClangSharp/Generated/CXObjCPropertyAttrKind.cs @@ -0,0 +1,20 @@ +namespace ClangSharp +{ + public enum CXObjCPropertyAttrKind + { + CXObjCPropertyAttr_noattr = 0, + CXObjCPropertyAttr_readonly = 1, + CXObjCPropertyAttr_getter = 2, + CXObjCPropertyAttr_assign = 4, + CXObjCPropertyAttr_readwrite = 8, + CXObjCPropertyAttr_retain = 16, + CXObjCPropertyAttr_copy = 32, + CXObjCPropertyAttr_nonatomic = 64, + CXObjCPropertyAttr_setter = 128, + CXObjCPropertyAttr_atomic = 256, + CXObjCPropertyAttr_weak = 512, + CXObjCPropertyAttr_strong = 1024, + CXObjCPropertyAttr_unsafe_unretained = 2048, + CXObjCPropertyAttr_class = 4096, + } +} diff --git a/ClangSharp/Generated/CXPlatformAvailability.cs b/ClangSharp/Generated/CXPlatformAvailability.cs new file mode 100644 index 00000000..189b5f5f --- /dev/null +++ b/ClangSharp/Generated/CXPlatformAvailability.cs @@ -0,0 +1,12 @@ +namespace ClangSharp +{ + public partial struct CXPlatformAvailability + { + public CXString Platform; + public CXVersion Introduced; + public CXVersion Deprecated; + public CXVersion Obsoleted; + public int Unavailable; + public CXString Message; + } +} diff --git a/ClangSharp/Generated/CXPrintingPolicy.cs b/ClangSharp/Generated/CXPrintingPolicy.cs new file mode 100644 index 00000000..13b0417e --- /dev/null +++ b/ClangSharp/Generated/CXPrintingPolicy.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXPrintingPolicy + { + public CXPrintingPolicy(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXPrintingPolicyProperty.cs b/ClangSharp/Generated/CXPrintingPolicyProperty.cs new file mode 100644 index 00000000..ca4af828 --- /dev/null +++ b/ClangSharp/Generated/CXPrintingPolicyProperty.cs @@ -0,0 +1,33 @@ +namespace ClangSharp +{ + public enum CXPrintingPolicyProperty + { + CXPrintingPolicy_Indentation = 0, + CXPrintingPolicy_SuppressSpecifiers = 1, + CXPrintingPolicy_SuppressTagKeyword = 2, + CXPrintingPolicy_IncludeTagDefinition = 3, + CXPrintingPolicy_SuppressScope = 4, + CXPrintingPolicy_SuppressUnwrittenScope = 5, + CXPrintingPolicy_SuppressInitializers = 6, + CXPrintingPolicy_ConstantArraySizeAsWritten = 7, + CXPrintingPolicy_AnonymousTagLocations = 8, + CXPrintingPolicy_SuppressStrongLifetime = 9, + CXPrintingPolicy_SuppressLifetimeQualifiers = 10, + CXPrintingPolicy_SuppressTemplateArgsInCXXConstructors = 11, + CXPrintingPolicy_Bool = 12, + CXPrintingPolicy_Restrict = 13, + CXPrintingPolicy_Alignof = 14, + CXPrintingPolicy_UnderscoreAlignof = 15, + CXPrintingPolicy_UseVoidForZeroParams = 16, + CXPrintingPolicy_TerseOutput = 17, + CXPrintingPolicy_PolishForDeclaration = 18, + CXPrintingPolicy_Half = 19, + CXPrintingPolicy_MSWChar = 20, + CXPrintingPolicy_IncludeNewlines = 21, + CXPrintingPolicy_MSVCFormatting = 22, + CXPrintingPolicy_ConstantsAsWritten = 23, + CXPrintingPolicy_SuppressImplicitBase = 24, + CXPrintingPolicy_FullyQualifiedName = 25, + CXPrintingPolicy_LastProperty = 25, + } +} diff --git a/ClangSharp/Generated/CXRefQualifierKind.cs b/ClangSharp/Generated/CXRefQualifierKind.cs new file mode 100644 index 00000000..43004eed --- /dev/null +++ b/ClangSharp/Generated/CXRefQualifierKind.cs @@ -0,0 +1,9 @@ +namespace ClangSharp +{ + public enum CXRefQualifierKind + { + CXRefQualifier_None = 0, + CXRefQualifier_LValue = 1, + CXRefQualifier_RValue = 2, + } +} diff --git a/ClangSharp/Generated/CXRemapping.cs b/ClangSharp/Generated/CXRemapping.cs new file mode 100644 index 00000000..8ff2b7fc --- /dev/null +++ b/ClangSharp/Generated/CXRemapping.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXRemapping + { + public CXRemapping(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXReparse_Flags.cs b/ClangSharp/Generated/CXReparse_Flags.cs new file mode 100644 index 00000000..129993e9 --- /dev/null +++ b/ClangSharp/Generated/CXReparse_Flags.cs @@ -0,0 +1,7 @@ +namespace ClangSharp +{ + public enum CXReparse_Flags + { + CXReparse_None = 0, + } +} diff --git a/ClangSharp/Generated/CXResult.cs b/ClangSharp/Generated/CXResult.cs new file mode 100644 index 00000000..73f44ded --- /dev/null +++ b/ClangSharp/Generated/CXResult.cs @@ -0,0 +1,9 @@ +namespace ClangSharp +{ + public enum CXResult + { + CXResult_Success = 0, + CXResult_Invalid = 1, + CXResult_VisitBreak = 2, + } +} diff --git a/ClangSharp/Generated/CXSaveError.cs b/ClangSharp/Generated/CXSaveError.cs new file mode 100644 index 00000000..df55aec2 --- /dev/null +++ b/ClangSharp/Generated/CXSaveError.cs @@ -0,0 +1,10 @@ +namespace ClangSharp +{ + public enum CXSaveError + { + CXSaveError_None = 0, + CXSaveError_Unknown = 1, + CXSaveError_TranslationErrors = 2, + CXSaveError_InvalidTU = 3, + } +} diff --git a/ClangSharp/Generated/CXSaveTranslationUnit_Flags.cs b/ClangSharp/Generated/CXSaveTranslationUnit_Flags.cs new file mode 100644 index 00000000..82a6674f --- /dev/null +++ b/ClangSharp/Generated/CXSaveTranslationUnit_Flags.cs @@ -0,0 +1,7 @@ +namespace ClangSharp +{ + public enum CXSaveTranslationUnit_Flags + { + CXSaveTranslationUnit_None = 0, + } +} diff --git a/ClangSharp/Generated/CXSourceLocation.cs b/ClangSharp/Generated/CXSourceLocation.cs new file mode 100644 index 00000000..8b093037 --- /dev/null +++ b/ClangSharp/Generated/CXSourceLocation.cs @@ -0,0 +1,10 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXSourceLocation + { + public IntPtr ptr_data0; public IntPtr ptr_data1; + public uint int_data; + } +} diff --git a/ClangSharp/Generated/CXSourceRange.cs b/ClangSharp/Generated/CXSourceRange.cs new file mode 100644 index 00000000..17b5a2e3 --- /dev/null +++ b/ClangSharp/Generated/CXSourceRange.cs @@ -0,0 +1,11 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXSourceRange + { + public IntPtr ptr_data0; public IntPtr ptr_data1; + public uint begin_int_data; + public uint end_int_data; + } +} diff --git a/ClangSharp/Generated/CXSourceRangeList.cs b/ClangSharp/Generated/CXSourceRangeList.cs new file mode 100644 index 00000000..7daa90b0 --- /dev/null +++ b/ClangSharp/Generated/CXSourceRangeList.cs @@ -0,0 +1,10 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXSourceRangeList + { + public uint count; + public IntPtr ranges; + } +} diff --git a/ClangSharp/Generated/CXString.cs b/ClangSharp/Generated/CXString.cs new file mode 100644 index 00000000..32b82d7c --- /dev/null +++ b/ClangSharp/Generated/CXString.cs @@ -0,0 +1,10 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXString + { + public IntPtr data; + public uint private_flags; + } +} diff --git a/ClangSharp/Generated/CXStringSet.cs b/ClangSharp/Generated/CXStringSet.cs new file mode 100644 index 00000000..bf5ad3ed --- /dev/null +++ b/ClangSharp/Generated/CXStringSet.cs @@ -0,0 +1,10 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXStringSet + { + public IntPtr Strings; + public uint Count; + } +} diff --git a/ClangSharp/Generated/CXSymbolRole.cs b/ClangSharp/Generated/CXSymbolRole.cs new file mode 100644 index 00000000..b123795d --- /dev/null +++ b/ClangSharp/Generated/CXSymbolRole.cs @@ -0,0 +1,16 @@ +namespace ClangSharp +{ + public enum CXSymbolRole + { + CXSymbolRole_None = 0, + CXSymbolRole_Declaration = 1, + CXSymbolRole_Definition = 2, + CXSymbolRole_Reference = 4, + CXSymbolRole_Read = 8, + CXSymbolRole_Write = 16, + CXSymbolRole_Call = 32, + CXSymbolRole_Dynamic = 64, + CXSymbolRole_AddressOf = 128, + CXSymbolRole_Implicit = 256, + } +} diff --git a/ClangSharp/Generated/CXTLSKind.cs b/ClangSharp/Generated/CXTLSKind.cs new file mode 100644 index 00000000..4943fe00 --- /dev/null +++ b/ClangSharp/Generated/CXTLSKind.cs @@ -0,0 +1,9 @@ +namespace ClangSharp +{ + public enum CXTLSKind + { + CXTLS_None = 0, + CXTLS_Dynamic = 1, + CXTLS_Static = 2, + } +} diff --git a/ClangSharp/Generated/CXTUResourceUsage.cs b/ClangSharp/Generated/CXTUResourceUsage.cs new file mode 100644 index 00000000..8810bafd --- /dev/null +++ b/ClangSharp/Generated/CXTUResourceUsage.cs @@ -0,0 +1,11 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXTUResourceUsage + { + public IntPtr data; + public uint numEntries; + public IntPtr entries; + } +} diff --git a/ClangSharp/Generated/CXTUResourceUsageEntry.cs b/ClangSharp/Generated/CXTUResourceUsageEntry.cs new file mode 100644 index 00000000..e6518a65 --- /dev/null +++ b/ClangSharp/Generated/CXTUResourceUsageEntry.cs @@ -0,0 +1,8 @@ +namespace ClangSharp +{ + public partial struct CXTUResourceUsageEntry + { + public CXTUResourceUsageKind kind; + public uint amount; + } +} diff --git a/ClangSharp/Generated/CXTUResourceUsageKind.cs b/ClangSharp/Generated/CXTUResourceUsageKind.cs new file mode 100644 index 00000000..eb8fa2bb --- /dev/null +++ b/ClangSharp/Generated/CXTUResourceUsageKind.cs @@ -0,0 +1,24 @@ +namespace ClangSharp +{ + public enum CXTUResourceUsageKind + { + CXTUResourceUsage_AST = 1, + CXTUResourceUsage_Identifiers = 2, + CXTUResourceUsage_Selectors = 3, + CXTUResourceUsage_GlobalCompletionResults = 4, + CXTUResourceUsage_SourceManagerContentCache = 5, + CXTUResourceUsage_AST_SideTables = 6, + CXTUResourceUsage_SourceManager_Membuffer_Malloc = 7, + CXTUResourceUsage_SourceManager_Membuffer_MMap = 8, + CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9, + CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10, + CXTUResourceUsage_Preprocessor = 11, + CXTUResourceUsage_PreprocessingRecord = 12, + CXTUResourceUsage_SourceManager_DataStructures = 13, + CXTUResourceUsage_Preprocessor_HeaderSearch = 14, + CXTUResourceUsage_MEMORY_IN_BYTES_BEGIN = 1, + CXTUResourceUsage_MEMORY_IN_BYTES_END = 14, + CXTUResourceUsage_First = 1, + CXTUResourceUsage_Last = 14, + } +} diff --git a/ClangSharp/Generated/CXTargetInfo.cs b/ClangSharp/Generated/CXTargetInfo.cs new file mode 100644 index 00000000..4356cf7d --- /dev/null +++ b/ClangSharp/Generated/CXTargetInfo.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXTargetInfo + { + public CXTargetInfo(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXTargetInfoImpl.cs b/ClangSharp/Generated/CXTargetInfoImpl.cs new file mode 100644 index 00000000..bc568a95 --- /dev/null +++ b/ClangSharp/Generated/CXTargetInfoImpl.cs @@ -0,0 +1,6 @@ +namespace ClangSharp +{ + public partial struct CXTargetInfoImpl + { + } +} diff --git a/ClangSharp/Generated/CXTemplateArgumentKind.cs b/ClangSharp/Generated/CXTemplateArgumentKind.cs new file mode 100644 index 00000000..3bbaffa6 --- /dev/null +++ b/ClangSharp/Generated/CXTemplateArgumentKind.cs @@ -0,0 +1,16 @@ +namespace ClangSharp +{ + public enum CXTemplateArgumentKind + { + CXTemplateArgumentKind_Null = 0, + CXTemplateArgumentKind_Type = 1, + CXTemplateArgumentKind_Declaration = 2, + CXTemplateArgumentKind_NullPtr = 3, + CXTemplateArgumentKind_Integral = 4, + CXTemplateArgumentKind_Template = 5, + CXTemplateArgumentKind_TemplateExpansion = 6, + CXTemplateArgumentKind_Expression = 7, + CXTemplateArgumentKind_Pack = 8, + CXTemplateArgumentKind_Invalid = 9, + } +} diff --git a/ClangSharp/Generated/CXToken.cs b/ClangSharp/Generated/CXToken.cs new file mode 100644 index 00000000..74adbc3c --- /dev/null +++ b/ClangSharp/Generated/CXToken.cs @@ -0,0 +1,10 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXToken + { + public uint int_data0; public uint int_data1; public uint int_data2; public uint int_data3; + public IntPtr ptr_data; + } +} diff --git a/ClangSharp/Generated/CXTokenKind.cs b/ClangSharp/Generated/CXTokenKind.cs new file mode 100644 index 00000000..dc2c090e --- /dev/null +++ b/ClangSharp/Generated/CXTokenKind.cs @@ -0,0 +1,11 @@ +namespace ClangSharp +{ + public enum CXTokenKind + { + CXToken_Punctuation = 0, + CXToken_Keyword = 1, + CXToken_Identifier = 2, + CXToken_Literal = 3, + CXToken_Comment = 4, + } +} diff --git a/ClangSharp/Generated/CXTranslationUnit.cs b/ClangSharp/Generated/CXTranslationUnit.cs new file mode 100644 index 00000000..c33b7065 --- /dev/null +++ b/ClangSharp/Generated/CXTranslationUnit.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXTranslationUnit + { + public CXTranslationUnit(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXTranslationUnitImpl.cs b/ClangSharp/Generated/CXTranslationUnitImpl.cs new file mode 100644 index 00000000..ec135ce5 --- /dev/null +++ b/ClangSharp/Generated/CXTranslationUnitImpl.cs @@ -0,0 +1,6 @@ +namespace ClangSharp +{ + public partial struct CXTranslationUnitImpl + { + } +} diff --git a/ClangSharp/Generated/CXTranslationUnit_Flags.cs b/ClangSharp/Generated/CXTranslationUnit_Flags.cs new file mode 100644 index 00000000..f0969fed --- /dev/null +++ b/ClangSharp/Generated/CXTranslationUnit_Flags.cs @@ -0,0 +1,21 @@ +namespace ClangSharp +{ + public enum CXTranslationUnit_Flags + { + CXTranslationUnit_None = 0, + CXTranslationUnit_DetailedPreprocessingRecord = 1, + CXTranslationUnit_Incomplete = 2, + CXTranslationUnit_PrecompiledPreamble = 4, + CXTranslationUnit_CacheCompletionResults = 8, + CXTranslationUnit_ForSerialization = 16, + CXTranslationUnit_CXXChainedPCH = 32, + CXTranslationUnit_SkipFunctionBodies = 64, + CXTranslationUnit_IncludeBriefCommentsInCodeCompletion = 128, + CXTranslationUnit_CreatePreambleOnFirstParse = 256, + CXTranslationUnit_KeepGoing = 512, + CXTranslationUnit_SingleFileParse = 1024, + CXTranslationUnit_LimitSkipFunctionBodiesToPreamble = 2048, + CXTranslationUnit_IncludeAttributedTypes = 4096, + CXTranslationUnit_VisitImplicitAttributes = 8192, + } +} diff --git a/ClangSharp/Generated/CXType.cs b/ClangSharp/Generated/CXType.cs new file mode 100644 index 00000000..e7991590 --- /dev/null +++ b/ClangSharp/Generated/CXType.cs @@ -0,0 +1,10 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXType + { + public CXTypeKind kind; + public IntPtr data0; public IntPtr data1; + } +} diff --git a/ClangSharp/Generated/CXTypeKind.cs b/ClangSharp/Generated/CXTypeKind.cs new file mode 100644 index 00000000..b425ae34 --- /dev/null +++ b/ClangSharp/Generated/CXTypeKind.cs @@ -0,0 +1,123 @@ +namespace ClangSharp +{ + public enum CXTypeKind + { + CXType_Invalid = 0, + CXType_Unexposed = 1, + CXType_Void = 2, + CXType_Bool = 3, + CXType_Char_U = 4, + CXType_UChar = 5, + CXType_Char16 = 6, + CXType_Char32 = 7, + CXType_UShort = 8, + CXType_UInt = 9, + CXType_ULong = 10, + CXType_ULongLong = 11, + CXType_UInt128 = 12, + CXType_Char_S = 13, + CXType_SChar = 14, + CXType_WChar = 15, + CXType_Short = 16, + CXType_Int = 17, + CXType_Long = 18, + CXType_LongLong = 19, + CXType_Int128 = 20, + CXType_Float = 21, + CXType_Double = 22, + CXType_LongDouble = 23, + CXType_NullPtr = 24, + CXType_Overload = 25, + CXType_Dependent = 26, + CXType_ObjCId = 27, + CXType_ObjCClass = 28, + CXType_ObjCSel = 29, + CXType_Float128 = 30, + CXType_Half = 31, + CXType_Float16 = 32, + CXType_ShortAccum = 33, + CXType_Accum = 34, + CXType_LongAccum = 35, + CXType_UShortAccum = 36, + CXType_UAccum = 37, + CXType_ULongAccum = 38, + CXType_FirstBuiltin = 2, + CXType_LastBuiltin = 38, + CXType_Complex = 100, + CXType_Pointer = 101, + CXType_BlockPointer = 102, + CXType_LValueReference = 103, + CXType_RValueReference = 104, + CXType_Record = 105, + CXType_Enum = 106, + CXType_Typedef = 107, + CXType_ObjCInterface = 108, + CXType_ObjCObjectPointer = 109, + CXType_FunctionNoProto = 110, + CXType_FunctionProto = 111, + CXType_ConstantArray = 112, + CXType_Vector = 113, + CXType_IncompleteArray = 114, + CXType_VariableArray = 115, + CXType_DependentSizedArray = 116, + CXType_MemberPointer = 117, + CXType_Auto = 118, + CXType_Elaborated = 119, + CXType_Pipe = 120, + CXType_OCLImage1dRO = 121, + CXType_OCLImage1dArrayRO = 122, + CXType_OCLImage1dBufferRO = 123, + CXType_OCLImage2dRO = 124, + CXType_OCLImage2dArrayRO = 125, + CXType_OCLImage2dDepthRO = 126, + CXType_OCLImage2dArrayDepthRO = 127, + CXType_OCLImage2dMSAARO = 128, + CXType_OCLImage2dArrayMSAARO = 129, + CXType_OCLImage2dMSAADepthRO = 130, + CXType_OCLImage2dArrayMSAADepthRO = 131, + CXType_OCLImage3dRO = 132, + CXType_OCLImage1dWO = 133, + CXType_OCLImage1dArrayWO = 134, + CXType_OCLImage1dBufferWO = 135, + CXType_OCLImage2dWO = 136, + CXType_OCLImage2dArrayWO = 137, + CXType_OCLImage2dDepthWO = 138, + CXType_OCLImage2dArrayDepthWO = 139, + CXType_OCLImage2dMSAAWO = 140, + CXType_OCLImage2dArrayMSAAWO = 141, + CXType_OCLImage2dMSAADepthWO = 142, + CXType_OCLImage2dArrayMSAADepthWO = 143, + CXType_OCLImage3dWO = 144, + CXType_OCLImage1dRW = 145, + CXType_OCLImage1dArrayRW = 146, + CXType_OCLImage1dBufferRW = 147, + CXType_OCLImage2dRW = 148, + CXType_OCLImage2dArrayRW = 149, + CXType_OCLImage2dDepthRW = 150, + CXType_OCLImage2dArrayDepthRW = 151, + CXType_OCLImage2dMSAARW = 152, + CXType_OCLImage2dArrayMSAARW = 153, + CXType_OCLImage2dMSAADepthRW = 154, + CXType_OCLImage2dArrayMSAADepthRW = 155, + CXType_OCLImage3dRW = 156, + CXType_OCLSampler = 157, + CXType_OCLEvent = 158, + CXType_OCLQueue = 159, + CXType_OCLReserveID = 160, + CXType_ObjCObject = 161, + CXType_ObjCTypeParam = 162, + CXType_Attributed = 163, + CXType_OCLIntelSubgroupAVCMcePayload = 164, + CXType_OCLIntelSubgroupAVCImePayload = 165, + CXType_OCLIntelSubgroupAVCRefPayload = 166, + CXType_OCLIntelSubgroupAVCSicPayload = 167, + CXType_OCLIntelSubgroupAVCMceResult = 168, + CXType_OCLIntelSubgroupAVCImeResult = 169, + CXType_OCLIntelSubgroupAVCRefResult = 170, + CXType_OCLIntelSubgroupAVCSicResult = 171, + CXType_OCLIntelSubgroupAVCImeResultSingleRefStreamout = 172, + CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout = 173, + CXType_OCLIntelSubgroupAVCImeSingleRefStreamin = 174, + CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175, + } +} diff --git a/ClangSharp/Generated/CXTypeLayoutError.cs b/ClangSharp/Generated/CXTypeLayoutError.cs new file mode 100644 index 00000000..f04488b9 --- /dev/null +++ b/ClangSharp/Generated/CXTypeLayoutError.cs @@ -0,0 +1,11 @@ +namespace ClangSharp +{ + public enum CXTypeLayoutError + { + CXTypeLayoutError_Invalid = -1, + CXTypeLayoutError_Incomplete = -2, + CXTypeLayoutError_Dependent = -3, + CXTypeLayoutError_NotConstantSize = -4, + CXTypeLayoutError_InvalidFieldName = -5, + } +} diff --git a/ClangSharp/Generated/CXTypeNullabilityKind.cs b/ClangSharp/Generated/CXTypeNullabilityKind.cs new file mode 100644 index 00000000..51b052b8 --- /dev/null +++ b/ClangSharp/Generated/CXTypeNullabilityKind.cs @@ -0,0 +1,10 @@ +namespace ClangSharp +{ + public enum CXTypeNullabilityKind + { + CXTypeNullability_NonNull = 0, + CXTypeNullability_Nullable = 1, + CXTypeNullability_Unspecified = 2, + CXTypeNullability_Invalid = 3, + } +} diff --git a/ClangSharp/Generated/CXUnsavedFile.cs b/ClangSharp/Generated/CXUnsavedFile.cs new file mode 100644 index 00000000..2b8af27c --- /dev/null +++ b/ClangSharp/Generated/CXUnsavedFile.cs @@ -0,0 +1,11 @@ +using System.Runtime.InteropServices; + +namespace ClangSharp +{ + public partial struct CXUnsavedFile + { + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(StringMarshaler))] public string Filename; + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(StringMarshaler))] public string Contents; + public uint Length; + } +} diff --git a/ClangSharp/Generated/CXVersion.cs b/ClangSharp/Generated/CXVersion.cs new file mode 100644 index 00000000..36518eae --- /dev/null +++ b/ClangSharp/Generated/CXVersion.cs @@ -0,0 +1,9 @@ +namespace ClangSharp +{ + public partial struct CXVersion + { + public int Major; + public int Minor; + public int Subminor; + } +} diff --git a/ClangSharp/Generated/CXVirtualFileOverlay.cs b/ClangSharp/Generated/CXVirtualFileOverlay.cs new file mode 100644 index 00000000..9d24efec --- /dev/null +++ b/ClangSharp/Generated/CXVirtualFileOverlay.cs @@ -0,0 +1,14 @@ +using System; + +namespace ClangSharp +{ + public partial struct CXVirtualFileOverlay + { + public CXVirtualFileOverlay(IntPtr pointer) + { + Pointer = pointer; + } + + public IntPtr Pointer; + } +} diff --git a/ClangSharp/Generated/CXVirtualFileOverlayImpl.cs b/ClangSharp/Generated/CXVirtualFileOverlayImpl.cs new file mode 100644 index 00000000..a3b6c6de --- /dev/null +++ b/ClangSharp/Generated/CXVirtualFileOverlayImpl.cs @@ -0,0 +1,6 @@ +namespace ClangSharp +{ + public partial struct CXVirtualFileOverlayImpl + { + } +} diff --git a/ClangSharp/Generated/CXVisibilityKind.cs b/ClangSharp/Generated/CXVisibilityKind.cs new file mode 100644 index 00000000..7026f64d --- /dev/null +++ b/ClangSharp/Generated/CXVisibilityKind.cs @@ -0,0 +1,10 @@ +namespace ClangSharp +{ + public enum CXVisibilityKind + { + CXVisibility_Invalid = 0, + CXVisibility_Hidden = 1, + CXVisibility_Protected = 2, + CXVisibility_Default = 3, + } +} diff --git a/ClangSharp/Generated/CXVisitorResult.cs b/ClangSharp/Generated/CXVisitorResult.cs new file mode 100644 index 00000000..b5c651a4 --- /dev/null +++ b/ClangSharp/Generated/CXVisitorResult.cs @@ -0,0 +1,8 @@ +namespace ClangSharp +{ + public enum CXVisitorResult + { + CXVisit_Break = 0, + CXVisit_Continue = 1, + } +} diff --git a/ClangSharp/Generated/CX_CXXAccessSpecifier.cs b/ClangSharp/Generated/CX_CXXAccessSpecifier.cs new file mode 100644 index 00000000..5206dbd3 --- /dev/null +++ b/ClangSharp/Generated/CX_CXXAccessSpecifier.cs @@ -0,0 +1,10 @@ +namespace ClangSharp +{ + public enum CX_CXXAccessSpecifier + { + CX_CXXInvalidAccessSpecifier = 0, + CX_CXXPublic = 1, + CX_CXXProtected = 2, + CX_CXXPrivate = 3, + } +} diff --git a/ClangSharp/Generated/CX_StorageClass.cs b/ClangSharp/Generated/CX_StorageClass.cs new file mode 100644 index 00000000..525f21ec --- /dev/null +++ b/ClangSharp/Generated/CX_StorageClass.cs @@ -0,0 +1,14 @@ +namespace ClangSharp +{ + public enum CX_StorageClass + { + CX_SC_Invalid = 0, + CX_SC_None = 1, + CX_SC_Extern = 2, + CX_SC_Static = 3, + CX_SC_PrivateExtern = 4, + CX_SC_OpenCLWorkGroupLocal = 5, + CX_SC_Auto = 6, + CX_SC_Register = 7, + } +} diff --git a/ClangSharp/Generated/IndexerCallbacks.cs b/ClangSharp/Generated/IndexerCallbacks.cs new file mode 100644 index 00000000..4c54f4c6 --- /dev/null +++ b/ClangSharp/Generated/IndexerCallbacks.cs @@ -0,0 +1,16 @@ +using System; + +namespace ClangSharp +{ + public partial struct IndexerCallbacks + { + public IntPtr abortQuery; + public IntPtr diagnostic; + public IntPtr enteredMainFile; + public IntPtr ppIncludedFile; + public IntPtr importedASTFile; + public IntPtr startedTranslationUnit; + public IntPtr indexDeclaration; + public IntPtr indexEntityReference; + } +} diff --git a/ClangSharp/Generated.cs b/ClangSharp/Generated/clang.cs similarity index 64% rename from ClangSharp/Generated.cs rename to ClangSharp/Generated/clang.cs index 2c94cb46..cf5f5f8f 100644 --- a/ClangSharp/Generated.cs +++ b/ClangSharp/Generated/clang.cs @@ -1,1453 +1,8 @@ +using System; +using System.Runtime.InteropServices; + namespace ClangSharp { - using System; - using System.Runtime.InteropServices; - - public partial struct CXIndex - { - public CXIndex(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public partial struct CXTargetInfoImpl - { - } - - public partial struct CXTargetInfo - { - public CXTargetInfo(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public partial struct CXTranslationUnitImpl - { - } - - public partial struct CXTranslationUnit - { - public CXTranslationUnit(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public partial struct CXClientData - { - public CXClientData(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public partial struct CXUnsavedFile - { - [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(StringMarshaler))] public string Filename; - [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(StringMarshaler))] public string Contents; - public uint Length; - } - - public enum CXAvailabilityKind - { - CXAvailability_Available = 0, - CXAvailability_Deprecated = 1, - CXAvailability_NotAvailable = 2, - CXAvailability_NotAccessible = 3, - } - - public partial struct CXVersion - { - public int Major; - public int Minor; - public int Subminor; - } - - public enum CXCursor_ExceptionSpecificationKind - { - CXCursor_ExceptionSpecificationKind_None = 0, - CXCursor_ExceptionSpecificationKind_DynamicNone = 1, - CXCursor_ExceptionSpecificationKind_Dynamic = 2, - CXCursor_ExceptionSpecificationKind_MSAny = 3, - CXCursor_ExceptionSpecificationKind_BasicNoexcept = 4, - CXCursor_ExceptionSpecificationKind_ComputedNoexcept = 5, - CXCursor_ExceptionSpecificationKind_Unevaluated = 6, - CXCursor_ExceptionSpecificationKind_Uninstantiated = 7, - CXCursor_ExceptionSpecificationKind_Unparsed = 8, - } - - public enum CXGlobalOptFlags - { - CXGlobalOpt_None = 0, - CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 1, - CXGlobalOpt_ThreadBackgroundPriorityForEditing = 2, - CXGlobalOpt_ThreadBackgroundPriorityForAll = 3, - } - - public partial struct CXFile - { - public CXFile(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public partial struct CXFileUniqueID - { - public ulong data0; public ulong data1; public ulong data2; - } - - public partial struct CXSourceLocation - { - public IntPtr ptr_data0; public IntPtr ptr_data1; - public uint int_data; - } - - public partial struct CXSourceRange - { - public IntPtr ptr_data0; public IntPtr ptr_data1; - public uint begin_int_data; - public uint end_int_data; - } - - public partial struct CXSourceRangeList - { - public uint count; - public IntPtr ranges; - } - - public enum CXDiagnosticSeverity - { - CXDiagnostic_Ignored = 0, - CXDiagnostic_Note = 1, - CXDiagnostic_Warning = 2, - CXDiagnostic_Error = 3, - CXDiagnostic_Fatal = 4, - } - - public partial struct CXDiagnostic - { - public CXDiagnostic(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public partial struct CXDiagnosticSet - { - public CXDiagnosticSet(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public enum CXLoadDiag_Error - { - CXLoadDiag_None = 0, - CXLoadDiag_Unknown = 1, - CXLoadDiag_CannotLoad = 2, - CXLoadDiag_InvalidFile = 3, - } - - public enum CXDiagnosticDisplayOptions - { - CXDiagnostic_DisplaySourceLocation = 1, - CXDiagnostic_DisplayColumn = 2, - CXDiagnostic_DisplaySourceRanges = 4, - CXDiagnostic_DisplayOption = 8, - CXDiagnostic_DisplayCategoryId = 16, - CXDiagnostic_DisplayCategoryName = 32, - } - - public enum CXTranslationUnit_Flags - { - CXTranslationUnit_None = 0, - CXTranslationUnit_DetailedPreprocessingRecord = 1, - CXTranslationUnit_Incomplete = 2, - CXTranslationUnit_PrecompiledPreamble = 4, - CXTranslationUnit_CacheCompletionResults = 8, - CXTranslationUnit_ForSerialization = 16, - CXTranslationUnit_CXXChainedPCH = 32, - CXTranslationUnit_SkipFunctionBodies = 64, - CXTranslationUnit_IncludeBriefCommentsInCodeCompletion = 128, - CXTranslationUnit_CreatePreambleOnFirstParse = 256, - CXTranslationUnit_KeepGoing = 512, - CXTranslationUnit_SingleFileParse = 1024, - CXTranslationUnit_LimitSkipFunctionBodiesToPreamble = 2048, - CXTranslationUnit_IncludeAttributedTypes = 4096, - CXTranslationUnit_VisitImplicitAttributes = 8192, - } - - public enum CXSaveTranslationUnit_Flags - { - CXSaveTranslationUnit_None = 0, - } - - public enum CXSaveError - { - CXSaveError_None = 0, - CXSaveError_Unknown = 1, - CXSaveError_TranslationErrors = 2, - CXSaveError_InvalidTU = 3, - } - - public enum CXReparse_Flags - { - CXReparse_None = 0, - } - - public enum CXTUResourceUsageKind - { - CXTUResourceUsage_AST = 1, - CXTUResourceUsage_Identifiers = 2, - CXTUResourceUsage_Selectors = 3, - CXTUResourceUsage_GlobalCompletionResults = 4, - CXTUResourceUsage_SourceManagerContentCache = 5, - CXTUResourceUsage_AST_SideTables = 6, - CXTUResourceUsage_SourceManager_Membuffer_Malloc = 7, - CXTUResourceUsage_SourceManager_Membuffer_MMap = 8, - CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9, - CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10, - CXTUResourceUsage_Preprocessor = 11, - CXTUResourceUsage_PreprocessingRecord = 12, - CXTUResourceUsage_SourceManager_DataStructures = 13, - CXTUResourceUsage_Preprocessor_HeaderSearch = 14, - CXTUResourceUsage_MEMORY_IN_BYTES_BEGIN = 1, - CXTUResourceUsage_MEMORY_IN_BYTES_END = 14, - CXTUResourceUsage_First = 1, - CXTUResourceUsage_Last = 14, - } - - public partial struct CXTUResourceUsageEntry - { - public CXTUResourceUsageKind kind; - public uint amount; - } - - public partial struct CXTUResourceUsage - { - public IntPtr data; - public uint numEntries; - public IntPtr entries; - } - - public enum CXCursorKind - { - CXCursor_UnexposedDecl = 1, - CXCursor_StructDecl = 2, - CXCursor_UnionDecl = 3, - CXCursor_ClassDecl = 4, - CXCursor_EnumDecl = 5, - CXCursor_FieldDecl = 6, - CXCursor_EnumConstantDecl = 7, - CXCursor_FunctionDecl = 8, - CXCursor_VarDecl = 9, - CXCursor_ParmDecl = 10, - CXCursor_ObjCInterfaceDecl = 11, - CXCursor_ObjCCategoryDecl = 12, - CXCursor_ObjCProtocolDecl = 13, - CXCursor_ObjCPropertyDecl = 14, - CXCursor_ObjCIvarDecl = 15, - CXCursor_ObjCInstanceMethodDecl = 16, - CXCursor_ObjCClassMethodDecl = 17, - CXCursor_ObjCImplementationDecl = 18, - CXCursor_ObjCCategoryImplDecl = 19, - CXCursor_TypedefDecl = 20, - CXCursor_CXXMethod = 21, - CXCursor_Namespace = 22, - CXCursor_LinkageSpec = 23, - CXCursor_Constructor = 24, - CXCursor_Destructor = 25, - CXCursor_ConversionFunction = 26, - CXCursor_TemplateTypeParameter = 27, - CXCursor_NonTypeTemplateParameter = 28, - CXCursor_TemplateTemplateParameter = 29, - CXCursor_FunctionTemplate = 30, - CXCursor_ClassTemplate = 31, - CXCursor_ClassTemplatePartialSpecialization = 32, - CXCursor_NamespaceAlias = 33, - CXCursor_UsingDirective = 34, - CXCursor_UsingDeclaration = 35, - CXCursor_TypeAliasDecl = 36, - CXCursor_ObjCSynthesizeDecl = 37, - CXCursor_ObjCDynamicDecl = 38, - CXCursor_CXXAccessSpecifier = 39, - CXCursor_FirstDecl = 1, - CXCursor_LastDecl = 39, - CXCursor_FirstRef = 40, - CXCursor_ObjCSuperClassRef = 40, - CXCursor_ObjCProtocolRef = 41, - CXCursor_ObjCClassRef = 42, - CXCursor_TypeRef = 43, - CXCursor_CXXBaseSpecifier = 44, - CXCursor_TemplateRef = 45, - CXCursor_NamespaceRef = 46, - CXCursor_MemberRef = 47, - CXCursor_LabelRef = 48, - CXCursor_OverloadedDeclRef = 49, - CXCursor_VariableRef = 50, - CXCursor_LastRef = 50, - CXCursor_FirstInvalid = 70, - CXCursor_InvalidFile = 70, - CXCursor_NoDeclFound = 71, - CXCursor_NotImplemented = 72, - CXCursor_InvalidCode = 73, - CXCursor_LastInvalid = 73, - CXCursor_FirstExpr = 100, - CXCursor_UnexposedExpr = 100, - CXCursor_DeclRefExpr = 101, - CXCursor_MemberRefExpr = 102, - CXCursor_CallExpr = 103, - CXCursor_ObjCMessageExpr = 104, - CXCursor_BlockExpr = 105, - CXCursor_IntegerLiteral = 106, - CXCursor_FloatingLiteral = 107, - CXCursor_ImaginaryLiteral = 108, - CXCursor_StringLiteral = 109, - CXCursor_CharacterLiteral = 110, - CXCursor_ParenExpr = 111, - CXCursor_UnaryOperator = 112, - CXCursor_ArraySubscriptExpr = 113, - CXCursor_BinaryOperator = 114, - CXCursor_CompoundAssignOperator = 115, - CXCursor_ConditionalOperator = 116, - CXCursor_CStyleCastExpr = 117, - CXCursor_CompoundLiteralExpr = 118, - CXCursor_InitListExpr = 119, - CXCursor_AddrLabelExpr = 120, - CXCursor_StmtExpr = 121, - CXCursor_GenericSelectionExpr = 122, - CXCursor_GNUNullExpr = 123, - CXCursor_CXXStaticCastExpr = 124, - CXCursor_CXXDynamicCastExpr = 125, - CXCursor_CXXReinterpretCastExpr = 126, - CXCursor_CXXConstCastExpr = 127, - CXCursor_CXXFunctionalCastExpr = 128, - CXCursor_CXXTypeidExpr = 129, - CXCursor_CXXBoolLiteralExpr = 130, - CXCursor_CXXNullPtrLiteralExpr = 131, - CXCursor_CXXThisExpr = 132, - CXCursor_CXXThrowExpr = 133, - CXCursor_CXXNewExpr = 134, - CXCursor_CXXDeleteExpr = 135, - CXCursor_UnaryExpr = 136, - CXCursor_ObjCStringLiteral = 137, - CXCursor_ObjCEncodeExpr = 138, - CXCursor_ObjCSelectorExpr = 139, - CXCursor_ObjCProtocolExpr = 140, - CXCursor_ObjCBridgedCastExpr = 141, - CXCursor_PackExpansionExpr = 142, - CXCursor_SizeOfPackExpr = 143, - CXCursor_LambdaExpr = 144, - CXCursor_ObjCBoolLiteralExpr = 145, - CXCursor_ObjCSelfExpr = 146, - CXCursor_OMPArraySectionExpr = 147, - CXCursor_ObjCAvailabilityCheckExpr = 148, - CXCursor_FixedPointLiteral = 149, - CXCursor_LastExpr = 149, - CXCursor_FirstStmt = 200, - CXCursor_UnexposedStmt = 200, - CXCursor_LabelStmt = 201, - CXCursor_CompoundStmt = 202, - CXCursor_CaseStmt = 203, - CXCursor_DefaultStmt = 204, - CXCursor_IfStmt = 205, - CXCursor_SwitchStmt = 206, - CXCursor_WhileStmt = 207, - CXCursor_DoStmt = 208, - CXCursor_ForStmt = 209, - CXCursor_GotoStmt = 210, - CXCursor_IndirectGotoStmt = 211, - CXCursor_ContinueStmt = 212, - CXCursor_BreakStmt = 213, - CXCursor_ReturnStmt = 214, - CXCursor_GCCAsmStmt = 215, - CXCursor_AsmStmt = 215, - CXCursor_ObjCAtTryStmt = 216, - CXCursor_ObjCAtCatchStmt = 217, - CXCursor_ObjCAtFinallyStmt = 218, - CXCursor_ObjCAtThrowStmt = 219, - CXCursor_ObjCAtSynchronizedStmt = 220, - CXCursor_ObjCAutoreleasePoolStmt = 221, - CXCursor_ObjCForCollectionStmt = 222, - CXCursor_CXXCatchStmt = 223, - CXCursor_CXXTryStmt = 224, - CXCursor_CXXForRangeStmt = 225, - CXCursor_SEHTryStmt = 226, - CXCursor_SEHExceptStmt = 227, - CXCursor_SEHFinallyStmt = 228, - CXCursor_MSAsmStmt = 229, - CXCursor_NullStmt = 230, - CXCursor_DeclStmt = 231, - CXCursor_OMPParallelDirective = 232, - CXCursor_OMPSimdDirective = 233, - CXCursor_OMPForDirective = 234, - CXCursor_OMPSectionsDirective = 235, - CXCursor_OMPSectionDirective = 236, - CXCursor_OMPSingleDirective = 237, - CXCursor_OMPParallelForDirective = 238, - CXCursor_OMPParallelSectionsDirective = 239, - CXCursor_OMPTaskDirective = 240, - CXCursor_OMPMasterDirective = 241, - CXCursor_OMPCriticalDirective = 242, - CXCursor_OMPTaskyieldDirective = 243, - CXCursor_OMPBarrierDirective = 244, - CXCursor_OMPTaskwaitDirective = 245, - CXCursor_OMPFlushDirective = 246, - CXCursor_SEHLeaveStmt = 247, - CXCursor_OMPOrderedDirective = 248, - CXCursor_OMPAtomicDirective = 249, - CXCursor_OMPForSimdDirective = 250, - CXCursor_OMPParallelForSimdDirective = 251, - CXCursor_OMPTargetDirective = 252, - CXCursor_OMPTeamsDirective = 253, - CXCursor_OMPTaskgroupDirective = 254, - CXCursor_OMPCancellationPointDirective = 255, - CXCursor_OMPCancelDirective = 256, - CXCursor_OMPTargetDataDirective = 257, - CXCursor_OMPTaskLoopDirective = 258, - CXCursor_OMPTaskLoopSimdDirective = 259, - CXCursor_OMPDistributeDirective = 260, - CXCursor_OMPTargetEnterDataDirective = 261, - CXCursor_OMPTargetExitDataDirective = 262, - CXCursor_OMPTargetParallelDirective = 263, - CXCursor_OMPTargetParallelForDirective = 264, - CXCursor_OMPTargetUpdateDirective = 265, - CXCursor_OMPDistributeParallelForDirective = 266, - CXCursor_OMPDistributeParallelForSimdDirective = 267, - CXCursor_OMPDistributeSimdDirective = 268, - CXCursor_OMPTargetParallelForSimdDirective = 269, - CXCursor_OMPTargetSimdDirective = 270, - CXCursor_OMPTeamsDistributeDirective = 271, - CXCursor_OMPTeamsDistributeSimdDirective = 272, - CXCursor_OMPTeamsDistributeParallelForSimdDirective = 273, - CXCursor_OMPTeamsDistributeParallelForDirective = 274, - CXCursor_OMPTargetTeamsDirective = 275, - CXCursor_OMPTargetTeamsDistributeDirective = 276, - CXCursor_OMPTargetTeamsDistributeParallelForDirective = 277, - CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective = 278, - CXCursor_OMPTargetTeamsDistributeSimdDirective = 279, - CXCursor_LastStmt = 279, - CXCursor_TranslationUnit = 300, - CXCursor_FirstAttr = 400, - CXCursor_UnexposedAttr = 400, - CXCursor_IBActionAttr = 401, - CXCursor_IBOutletAttr = 402, - CXCursor_IBOutletCollectionAttr = 403, - CXCursor_CXXFinalAttr = 404, - CXCursor_CXXOverrideAttr = 405, - CXCursor_AnnotateAttr = 406, - CXCursor_AsmLabelAttr = 407, - CXCursor_PackedAttr = 408, - CXCursor_PureAttr = 409, - CXCursor_ConstAttr = 410, - CXCursor_NoDuplicateAttr = 411, - CXCursor_CUDAConstantAttr = 412, - CXCursor_CUDADeviceAttr = 413, - CXCursor_CUDAGlobalAttr = 414, - CXCursor_CUDAHostAttr = 415, - CXCursor_CUDASharedAttr = 416, - CXCursor_VisibilityAttr = 417, - CXCursor_DLLExport = 418, - CXCursor_DLLImport = 419, - CXCursor_NSReturnsRetained = 420, - CXCursor_NSReturnsNotRetained = 421, - CXCursor_NSReturnsAutoreleased = 422, - CXCursor_NSConsumesSelf = 423, - CXCursor_NSConsumed = 424, - CXCursor_ObjCException = 425, - CXCursor_ObjCNSObject = 426, - CXCursor_ObjCIndependentClass = 427, - CXCursor_ObjCPreciseLifetime = 428, - CXCursor_ObjCReturnsInnerPointer = 429, - CXCursor_ObjCRequiresSuper = 430, - CXCursor_ObjCRootClass = 431, - CXCursor_ObjCSubclassingRestricted = 432, - CXCursor_ObjCExplicitProtocolImpl = 433, - CXCursor_ObjCDesignatedInitializer = 434, - CXCursor_ObjCRuntimeVisible = 435, - CXCursor_ObjCBoxable = 436, - CXCursor_FlagEnum = 437, - CXCursor_LastAttr = 437, - CXCursor_PreprocessingDirective = 500, - CXCursor_MacroDefinition = 501, - CXCursor_MacroExpansion = 502, - CXCursor_MacroInstantiation = 502, - CXCursor_InclusionDirective = 503, - CXCursor_FirstPreprocessing = 500, - CXCursor_LastPreprocessing = 503, - CXCursor_ModuleImportDecl = 600, - CXCursor_TypeAliasTemplateDecl = 601, - CXCursor_StaticAssert = 602, - CXCursor_FriendDecl = 603, - CXCursor_FirstExtraDecl = 600, - CXCursor_LastExtraDecl = 603, - CXCursor_OverloadCandidate = 700, - } - - public partial struct CXCursor - { - public CXCursorKind kind; - public int xdata; - public IntPtr data0; public IntPtr data1; public IntPtr data2; - } - - public enum CXLinkageKind - { - CXLinkage_Invalid = 0, - CXLinkage_NoLinkage = 1, - CXLinkage_Internal = 2, - CXLinkage_UniqueExternal = 3, - CXLinkage_External = 4, - } - - public enum CXVisibilityKind - { - CXVisibility_Invalid = 0, - CXVisibility_Hidden = 1, - CXVisibility_Protected = 2, - CXVisibility_Default = 3, - } - - public partial struct CXPlatformAvailability - { - public CXString Platform; - public CXVersion Introduced; - public CXVersion Deprecated; - public CXVersion Obsoleted; - public int Unavailable; - public CXString Message; - } - - public enum CXLanguageKind - { - CXLanguage_Invalid = 0, - CXLanguage_C = 1, - CXLanguage_ObjC = 2, - CXLanguage_CPlusPlus = 3, - } - - public enum CXTLSKind - { - CXTLS_None = 0, - CXTLS_Dynamic = 1, - CXTLS_Static = 2, - } - - public partial struct CXCursorSetImpl - { - } - - public partial struct CXCursorSet - { - public CXCursorSet(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public enum CXTypeKind - { - CXType_Invalid = 0, - CXType_Unexposed = 1, - CXType_Void = 2, - CXType_Bool = 3, - CXType_Char_U = 4, - CXType_UChar = 5, - CXType_Char16 = 6, - CXType_Char32 = 7, - CXType_UShort = 8, - CXType_UInt = 9, - CXType_ULong = 10, - CXType_ULongLong = 11, - CXType_UInt128 = 12, - CXType_Char_S = 13, - CXType_SChar = 14, - CXType_WChar = 15, - CXType_Short = 16, - CXType_Int = 17, - CXType_Long = 18, - CXType_LongLong = 19, - CXType_Int128 = 20, - CXType_Float = 21, - CXType_Double = 22, - CXType_LongDouble = 23, - CXType_NullPtr = 24, - CXType_Overload = 25, - CXType_Dependent = 26, - CXType_ObjCId = 27, - CXType_ObjCClass = 28, - CXType_ObjCSel = 29, - CXType_Float128 = 30, - CXType_Half = 31, - CXType_Float16 = 32, - CXType_ShortAccum = 33, - CXType_Accum = 34, - CXType_LongAccum = 35, - CXType_UShortAccum = 36, - CXType_UAccum = 37, - CXType_ULongAccum = 38, - CXType_FirstBuiltin = 2, - CXType_LastBuiltin = 38, - CXType_Complex = 100, - CXType_Pointer = 101, - CXType_BlockPointer = 102, - CXType_LValueReference = 103, - CXType_RValueReference = 104, - CXType_Record = 105, - CXType_Enum = 106, - CXType_Typedef = 107, - CXType_ObjCInterface = 108, - CXType_ObjCObjectPointer = 109, - CXType_FunctionNoProto = 110, - CXType_FunctionProto = 111, - CXType_ConstantArray = 112, - CXType_Vector = 113, - CXType_IncompleteArray = 114, - CXType_VariableArray = 115, - CXType_DependentSizedArray = 116, - CXType_MemberPointer = 117, - CXType_Auto = 118, - CXType_Elaborated = 119, - CXType_Pipe = 120, - CXType_OCLImage1dRO = 121, - CXType_OCLImage1dArrayRO = 122, - CXType_OCLImage1dBufferRO = 123, - CXType_OCLImage2dRO = 124, - CXType_OCLImage2dArrayRO = 125, - CXType_OCLImage2dDepthRO = 126, - CXType_OCLImage2dArrayDepthRO = 127, - CXType_OCLImage2dMSAARO = 128, - CXType_OCLImage2dArrayMSAARO = 129, - CXType_OCLImage2dMSAADepthRO = 130, - CXType_OCLImage2dArrayMSAADepthRO = 131, - CXType_OCLImage3dRO = 132, - CXType_OCLImage1dWO = 133, - CXType_OCLImage1dArrayWO = 134, - CXType_OCLImage1dBufferWO = 135, - CXType_OCLImage2dWO = 136, - CXType_OCLImage2dArrayWO = 137, - CXType_OCLImage2dDepthWO = 138, - CXType_OCLImage2dArrayDepthWO = 139, - CXType_OCLImage2dMSAAWO = 140, - CXType_OCLImage2dArrayMSAAWO = 141, - CXType_OCLImage2dMSAADepthWO = 142, - CXType_OCLImage2dArrayMSAADepthWO = 143, - CXType_OCLImage3dWO = 144, - CXType_OCLImage1dRW = 145, - CXType_OCLImage1dArrayRW = 146, - CXType_OCLImage1dBufferRW = 147, - CXType_OCLImage2dRW = 148, - CXType_OCLImage2dArrayRW = 149, - CXType_OCLImage2dDepthRW = 150, - CXType_OCLImage2dArrayDepthRW = 151, - CXType_OCLImage2dMSAARW = 152, - CXType_OCLImage2dArrayMSAARW = 153, - CXType_OCLImage2dMSAADepthRW = 154, - CXType_OCLImage2dArrayMSAADepthRW = 155, - CXType_OCLImage3dRW = 156, - CXType_OCLSampler = 157, - CXType_OCLEvent = 158, - CXType_OCLQueue = 159, - CXType_OCLReserveID = 160, - CXType_ObjCObject = 161, - CXType_ObjCTypeParam = 162, - CXType_Attributed = 163, - CXType_OCLIntelSubgroupAVCMcePayload = 164, - CXType_OCLIntelSubgroupAVCImePayload = 165, - CXType_OCLIntelSubgroupAVCRefPayload = 166, - CXType_OCLIntelSubgroupAVCSicPayload = 167, - CXType_OCLIntelSubgroupAVCMceResult = 168, - CXType_OCLIntelSubgroupAVCImeResult = 169, - CXType_OCLIntelSubgroupAVCRefResult = 170, - CXType_OCLIntelSubgroupAVCSicResult = 171, - CXType_OCLIntelSubgroupAVCImeResultSingleRefStreamout = 172, - CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout = 173, - CXType_OCLIntelSubgroupAVCImeSingleRefStreamin = 174, - CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175, - } - - public enum CXCallingConv - { - CXCallingConv_Default = 0, - CXCallingConv_C = 1, - CXCallingConv_X86StdCall = 2, - CXCallingConv_X86FastCall = 3, - CXCallingConv_X86ThisCall = 4, - CXCallingConv_X86Pascal = 5, - CXCallingConv_AAPCS = 6, - CXCallingConv_AAPCS_VFP = 7, - CXCallingConv_X86RegCall = 8, - CXCallingConv_IntelOclBicc = 9, - CXCallingConv_Win64 = 10, - CXCallingConv_X86_64Win64 = 10, - CXCallingConv_X86_64SysV = 11, - CXCallingConv_X86VectorCall = 12, - CXCallingConv_Swift = 13, - CXCallingConv_PreserveMost = 14, - CXCallingConv_PreserveAll = 15, - CXCallingConv_AArch64VectorCall = 16, - CXCallingConv_Invalid = 100, - CXCallingConv_Unexposed = 200, - } - - public partial struct CXType - { - public CXTypeKind kind; - public IntPtr data0; public IntPtr data1; - } - - public enum CXTemplateArgumentKind - { - CXTemplateArgumentKind_Null = 0, - CXTemplateArgumentKind_Type = 1, - CXTemplateArgumentKind_Declaration = 2, - CXTemplateArgumentKind_NullPtr = 3, - CXTemplateArgumentKind_Integral = 4, - CXTemplateArgumentKind_Template = 5, - CXTemplateArgumentKind_TemplateExpansion = 6, - CXTemplateArgumentKind_Expression = 7, - CXTemplateArgumentKind_Pack = 8, - CXTemplateArgumentKind_Invalid = 9, - } - - public enum CXTypeNullabilityKind - { - CXTypeNullability_NonNull = 0, - CXTypeNullability_Nullable = 1, - CXTypeNullability_Unspecified = 2, - CXTypeNullability_Invalid = 3, - } - - public enum CXTypeLayoutError - { - CXTypeLayoutError_Invalid = -1, - CXTypeLayoutError_Incomplete = -2, - CXTypeLayoutError_Dependent = -3, - CXTypeLayoutError_NotConstantSize = -4, - CXTypeLayoutError_InvalidFieldName = -5, - } - - public enum CXRefQualifierKind - { - CXRefQualifier_None = 0, - CXRefQualifier_LValue = 1, - CXRefQualifier_RValue = 2, - } - - public enum CX_CXXAccessSpecifier - { - CX_CXXInvalidAccessSpecifier = 0, - CX_CXXPublic = 1, - CX_CXXProtected = 2, - CX_CXXPrivate = 3, - } - - public enum CX_StorageClass - { - CX_SC_Invalid = 0, - CX_SC_None = 1, - CX_SC_Extern = 2, - CX_SC_Static = 3, - CX_SC_PrivateExtern = 4, - CX_SC_OpenCLWorkGroupLocal = 5, - CX_SC_Auto = 6, - CX_SC_Register = 7, - } - - public enum CXChildVisitResult - { - CXChildVisit_Break = 0, - CXChildVisit_Continue = 1, - CXChildVisit_Recurse = 2, - } - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate CXChildVisitResult CXCursorVisitor(CXCursor cursor, CXCursor parent, CXClientData client_data); - - public partial struct CXPrintingPolicy - { - public CXPrintingPolicy(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public enum CXPrintingPolicyProperty - { - CXPrintingPolicy_Indentation = 0, - CXPrintingPolicy_SuppressSpecifiers = 1, - CXPrintingPolicy_SuppressTagKeyword = 2, - CXPrintingPolicy_IncludeTagDefinition = 3, - CXPrintingPolicy_SuppressScope = 4, - CXPrintingPolicy_SuppressUnwrittenScope = 5, - CXPrintingPolicy_SuppressInitializers = 6, - CXPrintingPolicy_ConstantArraySizeAsWritten = 7, - CXPrintingPolicy_AnonymousTagLocations = 8, - CXPrintingPolicy_SuppressStrongLifetime = 9, - CXPrintingPolicy_SuppressLifetimeQualifiers = 10, - CXPrintingPolicy_SuppressTemplateArgsInCXXConstructors = 11, - CXPrintingPolicy_Bool = 12, - CXPrintingPolicy_Restrict = 13, - CXPrintingPolicy_Alignof = 14, - CXPrintingPolicy_UnderscoreAlignof = 15, - CXPrintingPolicy_UseVoidForZeroParams = 16, - CXPrintingPolicy_TerseOutput = 17, - CXPrintingPolicy_PolishForDeclaration = 18, - CXPrintingPolicy_Half = 19, - CXPrintingPolicy_MSWChar = 20, - CXPrintingPolicy_IncludeNewlines = 21, - CXPrintingPolicy_MSVCFormatting = 22, - CXPrintingPolicy_ConstantsAsWritten = 23, - CXPrintingPolicy_SuppressImplicitBase = 24, - CXPrintingPolicy_FullyQualifiedName = 25, - CXPrintingPolicy_LastProperty = 25, - } - - public enum CXObjCPropertyAttrKind - { - CXObjCPropertyAttr_noattr = 0, - CXObjCPropertyAttr_readonly = 1, - CXObjCPropertyAttr_getter = 2, - CXObjCPropertyAttr_assign = 4, - CXObjCPropertyAttr_readwrite = 8, - CXObjCPropertyAttr_retain = 16, - CXObjCPropertyAttr_copy = 32, - CXObjCPropertyAttr_nonatomic = 64, - CXObjCPropertyAttr_setter = 128, - CXObjCPropertyAttr_atomic = 256, - CXObjCPropertyAttr_weak = 512, - CXObjCPropertyAttr_strong = 1024, - CXObjCPropertyAttr_unsafe_unretained = 2048, - CXObjCPropertyAttr_class = 4096, - } - - public enum CXObjCDeclQualifierKind - { - CXObjCDeclQualifier_None = 0, - CXObjCDeclQualifier_In = 1, - CXObjCDeclQualifier_Inout = 2, - CXObjCDeclQualifier_Out = 4, - CXObjCDeclQualifier_Bycopy = 8, - CXObjCDeclQualifier_Byref = 16, - CXObjCDeclQualifier_Oneway = 32, - } - - public partial struct CXModule - { - public CXModule(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public enum CXNameRefFlags - { - CXNameRange_WantQualifier = 1, - CXNameRange_WantTemplateArgs = 2, - CXNameRange_WantSinglePiece = 4, - } - - public enum CXTokenKind - { - CXToken_Punctuation = 0, - CXToken_Keyword = 1, - CXToken_Identifier = 2, - CXToken_Literal = 3, - CXToken_Comment = 4, - } - - public partial struct CXToken - { - public uint int_data0; public uint int_data1; public uint int_data2; public uint int_data3; - public IntPtr ptr_data; - } - - public partial struct CXCompletionString - { - public CXCompletionString(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public partial struct CXCompletionResult - { - public CXCursorKind CursorKind; - public CXCompletionString CompletionString; - } - - public enum CXCompletionChunkKind - { - CXCompletionChunk_Optional = 0, - CXCompletionChunk_TypedText = 1, - CXCompletionChunk_Text = 2, - CXCompletionChunk_Placeholder = 3, - CXCompletionChunk_Informative = 4, - CXCompletionChunk_CurrentParameter = 5, - CXCompletionChunk_LeftParen = 6, - CXCompletionChunk_RightParen = 7, - CXCompletionChunk_LeftBracket = 8, - CXCompletionChunk_RightBracket = 9, - CXCompletionChunk_LeftBrace = 10, - CXCompletionChunk_RightBrace = 11, - CXCompletionChunk_LeftAngle = 12, - CXCompletionChunk_RightAngle = 13, - CXCompletionChunk_Comma = 14, - CXCompletionChunk_ResultType = 15, - CXCompletionChunk_Colon = 16, - CXCompletionChunk_SemiColon = 17, - CXCompletionChunk_Equal = 18, - CXCompletionChunk_HorizontalSpace = 19, - CXCompletionChunk_VerticalSpace = 20, - } - - public partial struct CXCodeCompleteResults - { - public IntPtr Results; - public uint NumResults; - } - - public enum CXCodeComplete_Flags - { - CXCodeComplete_IncludeMacros = 1, - CXCodeComplete_IncludeCodePatterns = 2, - CXCodeComplete_IncludeBriefComments = 4, - CXCodeComplete_SkipPreamble = 8, - CXCodeComplete_IncludeCompletionsWithFixIts = 16, - } - - public enum CXCompletionContext - { - CXCompletionContext_Unexposed = 0, - CXCompletionContext_AnyType = 1, - CXCompletionContext_AnyValue = 2, - CXCompletionContext_ObjCObjectValue = 4, - CXCompletionContext_ObjCSelectorValue = 8, - CXCompletionContext_CXXClassTypeValue = 16, - CXCompletionContext_DotMemberAccess = 32, - CXCompletionContext_ArrowMemberAccess = 64, - CXCompletionContext_ObjCPropertyAccess = 128, - CXCompletionContext_EnumTag = 256, - CXCompletionContext_UnionTag = 512, - CXCompletionContext_StructTag = 1024, - CXCompletionContext_ClassTag = 2048, - CXCompletionContext_Namespace = 4096, - CXCompletionContext_NestedNameSpecifier = 8192, - CXCompletionContext_ObjCInterface = 16384, - CXCompletionContext_ObjCProtocol = 32768, - CXCompletionContext_ObjCCategory = 65536, - CXCompletionContext_ObjCInstanceMessage = 131072, - CXCompletionContext_ObjCClassMessage = 262144, - CXCompletionContext_ObjCSelectorName = 524288, - CXCompletionContext_MacroName = 1048576, - CXCompletionContext_NaturalLanguage = 2097152, - CXCompletionContext_IncludedFile = 4194304, - CXCompletionContext_Unknown = 8388607, - } - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void CXInclusionVisitor(CXFile included_file, out CXSourceLocation inclusion_stack, uint include_len, CXClientData client_data); - - public enum CXEvalResultKind - { - CXEval_Int = 1, - CXEval_Float = 2, - CXEval_ObjCStrLiteral = 3, - CXEval_StrLiteral = 4, - CXEval_CFStr = 5, - CXEval_Other = 6, - CXEval_UnExposed = 0, - } - - public partial struct CXEvalResult - { - public CXEvalResult(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public partial struct CXRemapping - { - public CXRemapping(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public enum CXVisitorResult - { - CXVisit_Break = 0, - CXVisit_Continue = 1, - } - - public partial struct CXCursorAndRangeVisitor - { - public IntPtr context; - public IntPtr visit; - } - - public enum CXResult - { - CXResult_Success = 0, - CXResult_Invalid = 1, - CXResult_VisitBreak = 2, - } - - public partial struct CXIdxClientFile - { - public CXIdxClientFile(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public partial struct CXIdxClientEntity - { - public CXIdxClientEntity(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public partial struct CXIdxClientContainer - { - public CXIdxClientContainer(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public partial struct CXIdxClientASTFile - { - public CXIdxClientASTFile(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public partial struct CXIdxLoc - { - public IntPtr ptr_data0; public IntPtr ptr_data1; - public uint int_data; - } - - public partial struct CXIdxIncludedFileInfo - { - public CXIdxLoc hashLoc; - [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(StringMarshaler))] public string filename; - public CXFile file; - public int isImport; - public int isAngled; - public int isModuleImport; - } - - public partial struct CXIdxImportedASTFileInfo - { - public CXFile file; - public CXModule module; - public CXIdxLoc loc; - public int isImplicit; - } - - public enum CXIdxEntityKind - { - CXIdxEntity_Unexposed = 0, - CXIdxEntity_Typedef = 1, - CXIdxEntity_Function = 2, - CXIdxEntity_Variable = 3, - CXIdxEntity_Field = 4, - CXIdxEntity_EnumConstant = 5, - CXIdxEntity_ObjCClass = 6, - CXIdxEntity_ObjCProtocol = 7, - CXIdxEntity_ObjCCategory = 8, - CXIdxEntity_ObjCInstanceMethod = 9, - CXIdxEntity_ObjCClassMethod = 10, - CXIdxEntity_ObjCProperty = 11, - CXIdxEntity_ObjCIvar = 12, - CXIdxEntity_Enum = 13, - CXIdxEntity_Struct = 14, - CXIdxEntity_Union = 15, - CXIdxEntity_CXXClass = 16, - CXIdxEntity_CXXNamespace = 17, - CXIdxEntity_CXXNamespaceAlias = 18, - CXIdxEntity_CXXStaticVariable = 19, - CXIdxEntity_CXXStaticMethod = 20, - CXIdxEntity_CXXInstanceMethod = 21, - CXIdxEntity_CXXConstructor = 22, - CXIdxEntity_CXXDestructor = 23, - CXIdxEntity_CXXConversionFunction = 24, - CXIdxEntity_CXXTypeAlias = 25, - CXIdxEntity_CXXInterface = 26, - } - - public enum CXIdxEntityLanguage - { - CXIdxEntityLang_None = 0, - CXIdxEntityLang_C = 1, - CXIdxEntityLang_ObjC = 2, - CXIdxEntityLang_CXX = 3, - CXIdxEntityLang_Swift = 4, - } - - public enum CXIdxEntityCXXTemplateKind - { - CXIdxEntity_NonTemplate = 0, - CXIdxEntity_Template = 1, - CXIdxEntity_TemplatePartialSpecialization = 2, - CXIdxEntity_TemplateSpecialization = 3, - } - - public enum CXIdxAttrKind - { - CXIdxAttr_Unexposed = 0, - CXIdxAttr_IBAction = 1, - CXIdxAttr_IBOutlet = 2, - CXIdxAttr_IBOutletCollection = 3, - } - - public partial struct CXIdxAttrInfo - { - public CXIdxAttrKind kind; - public CXCursor cursor; - public CXIdxLoc loc; - } - - public partial struct CXIdxEntityInfo - { - public CXIdxEntityKind kind; - public CXIdxEntityCXXTemplateKind templateKind; - public CXIdxEntityLanguage lang; - [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(StringMarshaler))] public string name; - [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(StringMarshaler))] public string USR; - public CXCursor cursor; - public IntPtr attributes; - public uint numAttributes; - } - - public partial struct CXIdxContainerInfo - { - public CXCursor cursor; - } - - public partial struct CXIdxIBOutletCollectionAttrInfo - { - public IntPtr attrInfo; - public IntPtr objcClass; - public CXCursor classCursor; - public CXIdxLoc classLoc; - } - - public enum CXIdxDeclInfoFlags - { - CXIdxDeclFlag_Skipped = 1, - } - - public partial struct CXIdxDeclInfo - { - public IntPtr entityInfo; - public CXCursor cursor; - public CXIdxLoc loc; - public IntPtr semanticContainer; - public IntPtr lexicalContainer; - public int isRedeclaration; - public int isDefinition; - public int isContainer; - public IntPtr declAsContainer; - public int isImplicit; - public IntPtr attributes; - public uint numAttributes; - public uint flags; - } - - public enum CXIdxObjCContainerKind - { - CXIdxObjCContainer_ForwardRef = 0, - CXIdxObjCContainer_Interface = 1, - CXIdxObjCContainer_Implementation = 2, - } - - public partial struct CXIdxObjCContainerDeclInfo - { - public IntPtr declInfo; - public CXIdxObjCContainerKind kind; - } - - public partial struct CXIdxBaseClassInfo - { - public IntPtr @base; - public CXCursor cursor; - public CXIdxLoc loc; - } - - public partial struct CXIdxObjCProtocolRefInfo - { - public IntPtr protocol; - public CXCursor cursor; - public CXIdxLoc loc; - } - - public partial struct CXIdxObjCProtocolRefListInfo - { - public IntPtr protocols; - public uint numProtocols; - } - - public partial struct CXIdxObjCInterfaceDeclInfo - { - public IntPtr containerInfo; - public IntPtr superInfo; - public IntPtr protocols; - } - - public partial struct CXIdxObjCCategoryDeclInfo - { - public IntPtr containerInfo; - public IntPtr objcClass; - public CXCursor classCursor; - public CXIdxLoc classLoc; - public IntPtr protocols; - } - - public partial struct CXIdxObjCPropertyDeclInfo - { - public IntPtr declInfo; - public IntPtr getter; - public IntPtr setter; - } - - public partial struct CXIdxCXXClassDeclInfo - { - public IntPtr declInfo; - public IntPtr bases; - public uint numBases; - } - - public enum CXIdxEntityRefKind - { - CXIdxEntityRef_Direct = 1, - CXIdxEntityRef_Implicit = 2, - } - - public enum CXSymbolRole - { - CXSymbolRole_None = 0, - CXSymbolRole_Declaration = 1, - CXSymbolRole_Definition = 2, - CXSymbolRole_Reference = 4, - CXSymbolRole_Read = 8, - CXSymbolRole_Write = 16, - CXSymbolRole_Call = 32, - CXSymbolRole_Dynamic = 64, - CXSymbolRole_AddressOf = 128, - CXSymbolRole_Implicit = 256, - } - - public partial struct CXIdxEntityRefInfo - { - public CXIdxEntityRefKind kind; - public CXCursor cursor; - public CXIdxLoc loc; - public IntPtr referencedEntity; - public IntPtr parentEntity; - public IntPtr container; - public CXSymbolRole role; - } - - public partial struct IndexerCallbacks - { - public IntPtr abortQuery; - public IntPtr diagnostic; - public IntPtr enteredMainFile; - public IntPtr ppIncludedFile; - public IntPtr importedASTFile; - public IntPtr startedTranslationUnit; - public IntPtr indexDeclaration; - public IntPtr indexEntityReference; - } - - public partial struct CXIndexAction - { - public CXIndexAction(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public enum CXIndexOptFlags - { - CXIndexOpt_None = 0, - CXIndexOpt_SuppressRedundantRefs = 1, - CXIndexOpt_IndexFunctionLocalSymbols = 2, - CXIndexOpt_IndexImplicitTemplateInstantiations = 4, - CXIndexOpt_SuppressWarnings = 8, - CXIndexOpt_SkipParsedBodiesInSession = 16, - } - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate CXVisitorResult CXFieldVisitor(CXCursor C, CXClientData client_data); - - public partial struct CXString - { - public IntPtr data; - public uint private_flags; - } - - public partial struct CXStringSet - { - public IntPtr Strings; - public uint Count; - } - - public partial struct CXComment - { - public IntPtr ASTNode; - public CXTranslationUnit TranslationUnit; - } - - public enum CXCommentKind - { - CXComment_Null = 0, - CXComment_Text = 1, - CXComment_InlineCommand = 2, - CXComment_HTMLStartTag = 3, - CXComment_HTMLEndTag = 4, - CXComment_Paragraph = 5, - CXComment_BlockCommand = 6, - CXComment_ParamCommand = 7, - CXComment_TParamCommand = 8, - CXComment_VerbatimBlockCommand = 9, - CXComment_VerbatimBlockLine = 10, - CXComment_VerbatimLine = 11, - CXComment_FullComment = 12, - } - - public enum CXCommentInlineCommandRenderKind - { - CXCommentInlineCommandRenderKind_Normal = 0, - CXCommentInlineCommandRenderKind_Bold = 1, - CXCommentInlineCommandRenderKind_Monospaced = 2, - CXCommentInlineCommandRenderKind_Emphasized = 3, - } - - public enum CXCommentParamPassDirection - { - CXCommentParamPassDirection_In = 0, - CXCommentParamPassDirection_Out = 1, - CXCommentParamPassDirection_InOut = 2, - } - - public enum CXErrorCode - { - CXError_Success = 0, - CXError_Failure = 1, - CXError_Crashed = 2, - CXError_InvalidArguments = 3, - CXError_ASTReadError = 4, - } - - public partial struct CXVirtualFileOverlayImpl - { - } - - public partial struct CXVirtualFileOverlay - { - public CXVirtualFileOverlay(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public partial struct CXModuleMapDescriptorImpl - { - } - - public partial struct CXModuleMapDescriptor - { - public CXModuleMapDescriptor(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public partial struct CXCompilationDatabase - { - public CXCompilationDatabase(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public partial struct CXCompileCommands - { - public CXCompileCommands(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public partial struct CXCompileCommand - { - public CXCompileCommand(IntPtr pointer) - { - Pointer = pointer; - } - - public IntPtr Pointer; - } - - public enum CXCompilationDatabase_Error - { - CXCompilationDatabase_NoError = 0, - CXCompilationDatabase_CanNotLoadDatabase = 1, - } public static partial class clang { @@ -2533,6 +1088,5 @@ public static partial class clang [DllImport(libraryPath, EntryPoint = "clang_CompileCommand_getMappedSourceContent", CallingConvention = CallingConvention.Cdecl)] public static extern CXString CompileCommand_getMappedSourceContent(CXCompileCommand param0, uint I); - } } diff --git a/ClangSharpPInvokeGenerator/ConfigurationOptions.cs b/ClangSharpPInvokeGenerator/ConfigurationOptions.cs index 4dc4db25..9af13f25 100644 --- a/ClangSharpPInvokeGenerator/ConfigurationOptions.cs +++ b/ClangSharpPInvokeGenerator/ConfigurationOptions.cs @@ -8,6 +8,11 @@ public ConfigurationOptions(string[] options) { foreach (var option in options) { + if (option.EndsWith("multi-file")) + { + GenerateMultipleFiles = true; + } + if (option.Equals("unsafe")) { GenerateUnsafeCode = true; @@ -17,6 +22,8 @@ public ConfigurationOptions(string[] options) public string[] ExcludedFunctions { get; set; } + public bool GenerateMultipleFiles { get; set; } + public bool GenerateUnsafeCode { get; set; } public string LibraryPath { get; set; } @@ -26,5 +33,7 @@ public ConfigurationOptions(string[] options) public string MethodPrefixToStrip { get; set; } public string Namespace { get; set; } + + public string OutputLocation { get; set; } } } diff --git a/ClangSharpPInvokeGenerator/CursorWriter.cs b/ClangSharpPInvokeGenerator/CursorWriter.cs index 4baafa43..77efa0f6 100644 --- a/ClangSharpPInvokeGenerator/CursorWriter.cs +++ b/ClangSharpPInvokeGenerator/CursorWriter.cs @@ -7,29 +7,46 @@ namespace ClangSharpPInvokeGenerator { - internal class CursorWriter : CursorVisitor + internal class CursorWriter : CursorVisitor, IDisposable { private readonly Dictionary _attachedData; + private readonly Dictionary _outputBuilders; private readonly Stack _processingCursors; private readonly Stack _predicatedCursors; private readonly HashSet _visitedCursors; private readonly Func _predicate; - private readonly TextWriter _tw; private readonly ConfigurationOptions _config; - private int _indentation; + private OutputBuilder _outputBuilder; - public CursorWriter(ConfigurationOptions config, TextWriter tw, int indentation = 0, Func predicate = null) + public CursorWriter(ConfigurationOptions config, Func predicate = null) { _attachedData = new Dictionary(); + _outputBuilders = new Dictionary(); _processingCursors = new Stack(); _predicatedCursors = new Stack(); _visitedCursors = new HashSet(); _predicate = predicate ?? ((cursor) => true); - _tw = tw; _config = config; + } + + public void Dispose() + { + Debug.Assert(_outputBuilder is null); + + foreach (var outputBuilder in _outputBuilders) + { + Debug.Assert(outputBuilder.Key.Equals(outputBuilder.Value.OutputFile)); + outputBuilder.Value.Dispose(); + } - _indentation = indentation; + _outputBuilders.Clear(); + + Debug.Assert(_attachedData.Count == 0); + Debug.Assert(_processingCursors.Count == 0); + Debug.Assert(_predicatedCursors.Count == 0); + + _visitedCursors.Clear(); } protected override bool BeginHandle(CXCursor cursor, CXCursor parent) @@ -113,6 +130,8 @@ protected override bool BeginHandle(CXCursor cursor, CXCursor parent) protected override void EndHandle(CXCursor cursor, CXCursor parent) { + bool clearOutputBuilder = false; + if (!_processingCursors.TryPeek(out var processingCursor) || !cursor.Equals(processingCursor)) { return; @@ -123,6 +142,7 @@ protected override void EndHandle(CXCursor cursor, CXCursor parent) if (_predicatedCursors.TryPeek(out var activeCursor) && cursor.Equals(activeCursor)) { _predicatedCursors.Pop(); + clearOutputBuilder = true; } switch (cursor.Kind) @@ -132,26 +152,30 @@ protected override void EndHandle(CXCursor cursor, CXCursor parent) case CXCursorKind.CXCursor_UnexposedAttr: case CXCursorKind.CXCursor_DLLImport: { + clearOutputBuilder = false; break; } case CXCursorKind.CXCursor_StructDecl: case CXCursorKind.CXCursor_EnumDecl: { - WriteBlockEnd(); - WriteLine(); + _outputBuilder.WriteBlockEnd(); break; } case CXCursorKind.CXCursor_FieldDecl: { - WriteLine(';'); + _outputBuilder.WriteLine(';'); + + clearOutputBuilder = false; break; } case CXCursorKind.CXCursor_EnumConstantDecl: { - WriteLine(','); + _outputBuilder.WriteLine(','); + + clearOutputBuilder = false; break; } @@ -161,8 +185,7 @@ protected override void EndHandle(CXCursor cursor, CXCursor parent) { Debug.Assert(functionDeclData.RemainingParmCount == 0); - WriteLine(");"); - WriteLine(); + _outputBuilder.WriteLine(");"); _attachedData.Remove(cursor); } @@ -181,7 +204,7 @@ protected override void EndHandle(CXCursor cursor, CXCursor parent) if (functionDeclData.RemainingParmCount != 0) { - Write(", "); + _outputBuilder.Write(", "); } _attachedData[parent] = functionDeclData; } @@ -189,6 +212,8 @@ protected override void EndHandle(CXCursor cursor, CXCursor parent) { Unhandled(cursor, parent); } + + clearOutputBuilder = false; break; } @@ -207,16 +232,23 @@ protected override void EndHandle(CXCursor cursor, CXCursor parent) break; } } + + if (clearOutputBuilder) + { + _outputBuilder = null; + } } private bool BeginHandleEnumConstantDecl(CXCursor cursor, CXCursor parent) { Debug.Assert(cursor.Kind == CXCursorKind.CXCursor_EnumConstantDecl); - WriteIndentation(); - Write(GetEscapedCursorName(cursor)); - Write(" = "); - Write(cursor.EnumConstantDeclValue); + var name = GetCursorName(cursor); + + _outputBuilder.WriteIndentation(); + _outputBuilder.Write(EscapeName(name)); + _outputBuilder.Write(" = "); + _outputBuilder.Write(cursor.EnumConstantDeclValue); return false; } @@ -225,20 +257,23 @@ private bool BeginHandleEnumDecl(CXCursor cursor, CXCursor parent) { Debug.Assert(cursor.Kind == CXCursorKind.CXCursor_EnumDecl); - WriteIndented("public enum"); - Write(' '); - Write(GetEscapedCursorName(cursor)); + var name = GetCursorName(cursor); + InitializeOutputBuilder(name); + + _outputBuilder.WriteIndented("public enum"); + _outputBuilder.Write(' '); + _outputBuilder.Write(EscapeName(name)); var integerTypeName = GetTypeName(cursor, cursor.EnumDecl_IntegerType); if (!integerTypeName.Equals("int")) { - Write(" : "); - Write(integerTypeName); + _outputBuilder.Write(" : "); + _outputBuilder.Write(integerTypeName); } - WriteLine(); - WriteBlockStart(); + _outputBuilder.WriteLine(); + _outputBuilder.WriteBlockStart(); return true; } @@ -247,46 +282,51 @@ private bool BeginHandleFieldDecl(CXCursor cursor, CXCursor parent) { Debug.Assert(cursor.Kind == CXCursorKind.CXCursor_FieldDecl); - WriteIndentation(); + _outputBuilder.WriteIndentation(); var marshalAttribute = GetMarshalAttribute(cursor, cursor.Type); if (!string.IsNullOrWhiteSpace(marshalAttribute)) { - Write('['); - Write(marshalAttribute); - Write(']'); - Write(' '); + _outputBuilder.AddUsing("System.Runtime.InteropServices"); + + _outputBuilder.Write('['); + _outputBuilder.Write(marshalAttribute); + _outputBuilder.Write(']'); + _outputBuilder.Write(' '); } long lastElement = -1; + var name = GetCursorName(cursor); + var escapedName = EscapeName(name); + if (cursor.Type.kind == CXTypeKind.CXType_ConstantArray) { lastElement = cursor.Type.NumElements - 1; for (int i = 0; i < lastElement; i++) { - Write("public"); - Write(' '); - Write(GetTypeName(cursor, cursor.Type)); - Write(' '); - Write(GetEscapedCursorName(cursor)); - Write(i); - Write(';'); - Write(' '); + _outputBuilder.Write("public"); + _outputBuilder.Write(' '); + _outputBuilder.Write(GetTypeName(cursor, cursor.Type)); + _outputBuilder.Write(' '); + _outputBuilder.Write(escapedName); + _outputBuilder.Write(i); + _outputBuilder.Write(';'); + _outputBuilder.Write(' '); } } - Write("public"); - Write(' '); - Write(GetTypeName(cursor, cursor.Type)); - Write(' '); - Write(GetEscapedCursorName(cursor)); + _outputBuilder.Write("public"); + _outputBuilder.Write(' '); + _outputBuilder.Write(GetTypeName(cursor, cursor.Type)); + _outputBuilder.Write(' '); + _outputBuilder.Write(escapedName); if (lastElement != -1) { - Write(lastElement); + _outputBuilder.Write(lastElement); } return false; } @@ -303,23 +343,26 @@ private bool BeginHandleFunctionDecl(CXCursor cursor, CXCursor parent) { return false; } + InitializeOutputBuilder(_config.MethodClassName); _attachedData.Add(cursor, new AttachedFunctionDeclData(type.NumArgTypes)); - WriteIndented("[DllImport(libraryPath, EntryPoint = \""); - Write(name); - Write("\", CallingConvention = CallingConvention."); - Write(GetCallingConventionName(cursor, type.FunctionTypeCallingConv)); - WriteLine(")]"); + _outputBuilder.AddUsing("System.Runtime.InteropServices"); + + _outputBuilder.WriteIndented("[DllImport(libraryPath, EntryPoint = \""); + _outputBuilder.Write(name); + _outputBuilder.Write("\", CallingConvention = CallingConvention."); + _outputBuilder.Write(GetCallingConventionName(cursor, type.FunctionTypeCallingConv)); + _outputBuilder.WriteLine(")]"); var marshalAttribute = GetMarshalAttribute(cursor, type.ResultType); if (!string.IsNullOrWhiteSpace(marshalAttribute)) { - WriteIndented("[return: "); - Write(marshalAttribute); - Write(']'); - WriteLine(); + _outputBuilder.WriteIndented("[return: "); + _outputBuilder.Write(marshalAttribute); + _outputBuilder.Write(']'); + _outputBuilder.WriteLine(); } if (name.StartsWith(_config.MethodPrefixToStrip)) @@ -328,12 +371,12 @@ private bool BeginHandleFunctionDecl(CXCursor cursor, CXCursor parent) } name = EscapeName(name); - WriteIndented("public static extern"); - Write(' '); - Write(GetTypeName(cursor, type.ResultType)); - Write(' '); - Write(name); - Write('('); + _outputBuilder.WriteIndented("public static extern"); + _outputBuilder.Write(' '); + _outputBuilder.Write(GetTypeName(cursor, type.ResultType)); + _outputBuilder.Write(' '); + _outputBuilder.Write(name); + _outputBuilder.Write('('); return true; } @@ -348,29 +391,29 @@ private bool BeginHandleParmDecl(CXCursor cursor, CXCursor parent) if (!string.IsNullOrWhiteSpace(marshalAttribute)) { - Write("["); - Write(marshalAttribute); - Write(']'); - Write(' '); + _outputBuilder.Write("["); + _outputBuilder.Write(marshalAttribute); + _outputBuilder.Write(']'); + _outputBuilder.Write(' '); } var parmModifier = GetParmModifier(cursor, cursor.Type); if (!string.IsNullOrWhiteSpace(parmModifier)) { - Write(parmModifier); - Write(' '); + _outputBuilder.Write(parmModifier); + _outputBuilder.Write(' '); } - Write(GetTypeName(cursor, cursor.Type)); - Write(' '); + _outputBuilder.Write(GetTypeName(cursor, cursor.Type)); + _outputBuilder.Write(' '); - var name = GetEscapedCursorName(cursor); - Write(name); + var name = GetCursorName(cursor); + _outputBuilder.Write(EscapeName(name)); if (name.Equals("param")) { - Write(functionDeclData.ParmCount - functionDeclData.RemainingParmCount); + _outputBuilder.Write(functionDeclData.ParmCount - functionDeclData.RemainingParmCount); } return true; } @@ -386,19 +429,22 @@ private bool BeginHandleStructDecl(CXCursor cursor, CXCursor parent) { Debug.Assert(cursor.Kind == CXCursorKind.CXCursor_StructDecl); - WriteIndented("public"); + var name = GetCursorName(cursor); + InitializeOutputBuilder(name); + + _outputBuilder.WriteIndented("public"); if (_config.GenerateUnsafeCode) { - Write(' '); - Write("unsafe"); + _outputBuilder.Write(' '); + _outputBuilder.Write("unsafe"); } - Write(' '); + _outputBuilder.Write(' '); - Write("partial struct"); - Write(' '); - WriteLine(GetEscapedCursorName(cursor)); - WriteBlockStart(); + _outputBuilder.Write("partial struct"); + _outputBuilder.Write(' '); + _outputBuilder.WriteLine(EscapeName(name)); + _outputBuilder.WriteBlockStart(); return true; } @@ -422,38 +468,38 @@ private bool BeginHandleTypedefDecl(CXCursor cursor, CXCursor parent, CXType und { if (!_config.GenerateUnsafeCode) { - var escapedName = GetEscapedCursorName(cursor); + var name = GetCursorName(cursor); + var escapedName = EscapeName(name); - WriteIndented("public partial struct"); - Write(' '); - WriteLine(escapedName); - WriteBlockStart(); + _outputBuilder.WriteIndented("public partial struct"); + _outputBuilder.Write(' '); + _outputBuilder.WriteLine(escapedName); + _outputBuilder.WriteBlockStart(); { var typeName = GetTypeName(cursor, underlyingType); - WriteIndented("public"); - Write(' '); - Write(escapedName); - Write('('); - Write(typeName); - Write(' '); - Write("value"); - WriteLine(')'); - WriteBlockStart(); + _outputBuilder.WriteIndented("public"); + _outputBuilder.Write(' '); + _outputBuilder.Write(escapedName); + _outputBuilder.Write('('); + _outputBuilder.Write(typeName); + _outputBuilder.Write(' '); + _outputBuilder.Write("value"); + _outputBuilder.WriteLine(')'); + _outputBuilder.WriteBlockStart(); { - WriteIndentedLine("Value = value;"); + _outputBuilder.WriteIndentedLine("Value = value;"); } - WriteBlockEnd(); - WriteLine(); - WriteIndented("public"); - Write(' '); - Write(typeName); - Write(' '); - Write("Value"); - WriteLine(';'); + _outputBuilder.WriteBlockEnd(); + _outputBuilder.WriteLine(); + _outputBuilder.WriteIndented("public"); + _outputBuilder.Write(' '); + _outputBuilder.Write(typeName); + _outputBuilder.Write(' '); + _outputBuilder.Write("Value"); + _outputBuilder.WriteLine(';'); } - WriteBlockEnd(); - WriteLine(); + _outputBuilder.WriteBlockEnd(); } return true; } @@ -494,25 +540,31 @@ private bool BeginHandleTypedefDeclForPointer(CXCursor cursor, CXCursor parent, { if (!_config.GenerateUnsafeCode) { - WriteIndented("public partial struct"); - Write(' '); - WriteLine(GetEscapedCursorName(cursor)); - WriteBlockStart(); + var name = GetCursorName(cursor); + InitializeOutputBuilder(name); + + var escapedName = EscapeName(name); + + _outputBuilder.AddUsing("System"); + + _outputBuilder.WriteIndented("public partial struct"); + _outputBuilder.Write(' '); + _outputBuilder.WriteLine(escapedName); + _outputBuilder.WriteBlockStart(); { - WriteIndented("public"); - Write(' '); - Write(GetEscapedCursorName(cursor)); - WriteLine("(IntPtr pointer)"); - WriteBlockStart(); + _outputBuilder.WriteIndented("public"); + _outputBuilder.Write(' '); + _outputBuilder.Write(escapedName); + _outputBuilder.WriteLine("(IntPtr pointer)"); + _outputBuilder.WriteBlockStart(); { - WriteIndentedLine("Pointer = pointer;"); + _outputBuilder.WriteIndentedLine("Pointer = pointer;"); } - WriteBlockEnd(); - WriteLine(); - WriteIndentedLine("public IntPtr Pointer;"); + _outputBuilder.WriteBlockEnd(); + _outputBuilder.WriteLine(); + _outputBuilder.WriteIndentedLine("public IntPtr Pointer;"); } - WriteBlockEnd(); - WriteLine(); + _outputBuilder.WriteBlockEnd(); } return true; } @@ -520,18 +572,22 @@ private bool BeginHandleTypedefDeclForPointer(CXCursor cursor, CXCursor parent, case CXTypeKind.CXType_FunctionProto: { var name = GetCursorName(cursor); + InitializeOutputBuilder(name); + _attachedData.Add(cursor, new AttachedFunctionDeclData(pointeeType.NumArgTypes)); - name = EscapeName(name); - - WriteIndented("[UnmanagedFunctionPointer(CallingConvention."); - Write(GetCallingConventionName(cursor, pointeeType.FunctionTypeCallingConv)); - WriteLine(")]"); - WriteIndented("public delegate"); - Write(' '); - Write(GetTypeName(cursor, pointeeType.ResultType)); - Write(' '); - Write(name); - Write('('); + var escapedName = EscapeName(name); + + _outputBuilder.AddUsing("System.Runtime.InteropServices"); + + _outputBuilder.WriteIndented("[UnmanagedFunctionPointer(CallingConvention."); + _outputBuilder.Write(GetCallingConventionName(cursor, pointeeType.FunctionTypeCallingConv)); + _outputBuilder.WriteLine(")]"); + _outputBuilder.WriteIndented("public delegate"); + _outputBuilder.Write(' '); + _outputBuilder.Write(GetTypeName(cursor, pointeeType.ResultType)); + _outputBuilder.Write(' '); + _outputBuilder.Write(escapedName); + _outputBuilder.Write('('); return true; } @@ -733,12 +789,14 @@ private string GetCursorName(CXCursor cursor) case "intptr_t": { + _outputBuilder.AddUsing("System"); return "IntPtr"; } case "size_t": case "SIZE_T": { + _outputBuilder.AddUsing("System"); return "IntPtr"; } @@ -769,6 +827,7 @@ private string GetCursorName(CXCursor cursor) case "uintptr_t": { + _outputBuilder.AddUsing("System"); return "UIntPtr"; } @@ -840,12 +899,6 @@ private string GetCursorNameForTypedefDecl(CXCursor cursor, CXType underlyingTyp } } - private string GetEscapedCursorName(CXCursor cursor) - { - var name = GetCursorName(cursor); - return EscapeName(name); - } - private string GetMarshalAttribute(CXCursor cursor, CXType type) { if (_config.GenerateUnsafeCode) @@ -1153,11 +1206,18 @@ private string GetTypeNameForPointeeType(CXCursor cursor, CXType pointeeType) { case CXTypeKind.CXType_Void: { - return _config.GenerateUnsafeCode ? "void*" : "IntPtr"; + if (_config.GenerateUnsafeCode) + { + return "void*"; + } + + _outputBuilder.AddUsing("System"); + return "IntPtr"; } case CXTypeKind.CXType_FunctionProto: { + _outputBuilder.AddUsing("System"); return "IntPtr"; } @@ -1186,6 +1246,11 @@ private string GetTypeNameForPointeeType(CXCursor cursor, CXType pointeeType) name = GetTypeName(cursor, pointeeType); name += '*'; } + else + { + _outputBuilder.AddUsing("System"); + } + return name; } @@ -1239,6 +1304,7 @@ private string GetTypeNameForPointeeType(CXCursor cursor, CXType pointeeType) if (GetParmModifier(cursor, cursor.Type).Equals("out")) { Debug.Assert(!_config.GenerateUnsafeCode); + _outputBuilder.AddUsing("System"); return "IntPtr"; } @@ -1271,65 +1337,49 @@ private string GetTypeNameForPointeeType(CXCursor cursor, CXType pointeeType) } } - private void Unhandled(CXCursor cursor) + private void InitializeOutputBuilder(string name) { - Debug.WriteLine($"Unhandled cursor kind: {cursor.KindSpelling}"); - Debugger.Break(); - } - - private CXChildVisitResult Unhandled(CXCursor cursor, CXType type) - { - Debug.WriteLine($"Unhandled type kind: {type.KindSpelling} in {cursor.KindSpelling}."); - Debugger.Break(); - return CXChildVisitResult.CXChildVisit_Break; - } - - private void WriteBlockStart() - { - WriteIndentedLine('{'); - _indentation++; - } + if (_outputBuilder != null) + { + return; + } - private void WriteBlockEnd() - { - _indentation--; - WriteIndentedLine('}'); - } + var outputFile = _config.OutputLocation; + var isMethodClass = name.Equals(_config.MethodClassName); - private void Write(T value) - { - _tw.Write(value); - } - - private void WriteIndentation() - { - for (var i = 0; i < _indentation; i++) + if (_config.GenerateMultipleFiles) { - _tw.Write(" "); + outputFile = Path.Combine(outputFile, $"{name}.cs"); + } + else if (isMethodClass) + { + outputFile = Path.ChangeExtension(outputFile, $"{_config.MethodClassName}{Path.GetExtension(outputFile)}"); } - } - private void WriteIndented(T value) - { - WriteIndentation(); - Write(value); - } + if (!_outputBuilders.TryGetValue(outputFile, out _outputBuilder)) + { + _outputBuilder = new OutputBuilder(outputFile, _config, isMethodClass); + _outputBuilders.Add(outputFile, _outputBuilder); + } + else + { + _outputBuilder.WriteLine(); + } - private void WriteIndentedLine(T value) - { - WriteIndentation(); - WriteLine(value); + Debug.Assert(outputFile.Equals(_outputBuilder.OutputFile)); } - private void WriteLine(T value) + private void Unhandled(CXCursor cursor) { - Write(value); - WriteLine(); + Debug.WriteLine($"Unhandled cursor kind: {cursor.KindSpelling}"); + Debugger.Break(); } - private void WriteLine() + private CXChildVisitResult Unhandled(CXCursor cursor, CXType type) { - _tw.WriteLine(); + Debug.WriteLine($"Unhandled type kind: {type.KindSpelling} in {cursor.KindSpelling}."); + Debugger.Break(); + return CXChildVisitResult.CXChildVisit_Break; } } } diff --git a/ClangSharpPInvokeGenerator/OutputBuilder.cs b/ClangSharpPInvokeGenerator/OutputBuilder.cs new file mode 100644 index 00000000..26e07165 --- /dev/null +++ b/ClangSharpPInvokeGenerator/OutputBuilder.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace ClangSharpPInvokeGenerator +{ + internal sealed class OutputBuilder : IDisposable + { + private string _outputFile; + private StringBuilder _output; + private SortedSet _usings; + private ConfigurationOptions _config; + private int _indentation; + + public OutputBuilder(string outputFile, ConfigurationOptions config, bool isMethodClass) + { + _outputFile = outputFile; + _output = new StringBuilder(); + _usings = new SortedSet(); + _config = config; + _indentation = 0; + + WriteIndented("namespace"); + Write(' '); + WriteLine(_config.Namespace); + WriteBlockStart(); + + if (isMethodClass) + { + WriteLine(); + WriteIndented("public static"); + Write(' '); + + if (_config.GenerateUnsafeCode) + { + Write("unsafe"); + Write(' '); + } + + Write("partial class"); + Write(' '); + WriteLine(_config.MethodClassName); + WriteBlockStart(); + WriteIndented("private const string libraryPath = "); + Write('"'); + Write(_config.LibraryPath); + Write('"'); + WriteLine(';'); + WriteLine(); + } + } + + public string OutputFile => _outputFile; + + public void AddUsing(string @namespace) + { + _usings.Add(@namespace); + } + + public void Dispose() + { + while (_indentation != 0) + { + WriteBlockEnd(); + } + + using (var sw = new StreamWriter(_outputFile)) + { + if (_usings.Count != 0) + { + foreach (var @using in _usings) + { + sw.Write("using"); + sw.Write(' '); + sw.Write(@using); + sw.WriteLine(';'); + } + + sw.WriteLine(); + } + + sw.Write(_output); + } + + _outputFile = null; + _output = null; + _indentation = 0; + _config = null; + } + + public void WriteBlockStart() + { + WriteIndentedLine('{'); + _indentation++; + } + + public void WriteBlockEnd() + { + _indentation--; + WriteIndentedLine('}'); + } + + public void Write(T value) + { + _output.Append(value); + } + + public void WriteIndentation() + { + for (var i = 0; i < _indentation; i++) + { + _output.Append(" "); + } + } + + public void WriteIndented(T value) + { + WriteIndentation(); + Write(value); + } + + public void WriteIndentedLine(T value) + { + WriteIndentation(); + WriteLine(value); + } + + public void WriteLine(T value) + { + Write(value); + WriteLine(); + } + + public void WriteLine() + { + _output.AppendLine(); + } + } +} diff --git a/ClangSharpPInvokeGenerator/Program.cs b/ClangSharpPInvokeGenerator/Program.cs index 501f2fce..88ed382e 100644 --- a/ClangSharpPInvokeGenerator/Program.cs +++ b/ClangSharpPInvokeGenerator/Program.cs @@ -46,7 +46,7 @@ public static int Run(InvocationContext context) config.LibraryPath = context.ParseResult.ValueForOption("libraryPath"); config.MethodClassName = context.ParseResult.ValueForOption("methodClassName"); config.Namespace = context.ParseResult.ValueForOption("namespace"); - var outputFile = context.ParseResult.ValueForOption("output"); + config.OutputLocation = context.ParseResult.ValueForOption("output"); config.MethodPrefixToStrip = context.ParseResult.ValueForOption("prefixStrip"); var errorList = new List(); @@ -61,7 +61,7 @@ public static int Run(InvocationContext context) errorList.Add("Error: No namespace provided. Use --namespace or -n"); } - if (string.IsNullOrWhiteSpace(outputFile)) + if (string.IsNullOrWhiteSpace(config.OutputLocation)) { errorList.Add("Error: No output file location provided. Use --output or -o"); } @@ -83,84 +83,39 @@ public static int Run(InvocationContext context) return -1; } - var createIndex = CXIndex.Create(); string[] arr = { "-x", "c++" }; arr = arr.Concat(includeDirs.Select(x => "-I" + x)).ToArray(); arr = arr.Concat(defines.Select(x => "-D" + x)).ToArray(); arr = arr.Concat(additionalArgs).ToArray(); - var translationUnits = new List(); - - foreach (var file in files) + using (var createIndex = CXIndex.Create()) + using (var writer = new CursorWriter(config)) { - CXTranslationUnit translationUnit; - CXUnsavedFile[] unsavedFile = new CXUnsavedFile[0]; - var translationUnitError = CXTranslationUnit.Parse(createIndex, file, arr, unsavedFile, CXTranslationUnit_Flags.CXTranslationUnit_None, out translationUnit); - - if (translationUnitError != CXErrorCode.CXError_Success) + foreach (var file in files) { - Console.WriteLine($"Error: '{translationUnitError}' for '{file}'."); - var numDiagnostics = translationUnit.NumDiagnostics; + var translationUnitError = CXTranslationUnit.Parse(createIndex, file, arr, Array.Empty(), CXTranslationUnit_Flags.CXTranslationUnit_None, out CXTranslationUnit translationUnit); - for (uint i = 0; i < numDiagnostics; ++i) + if (translationUnitError != CXErrorCode.CXError_Success) { - var diagnostic = translationUnit.GetDiagnostic(i); - Console.WriteLine(diagnostic.Spelling.ToString()); - diagnostic.Dispose(); + Console.WriteLine($"Error: '{translationUnitError}' for '{file}'."); + var numDiagnostics = translationUnit.NumDiagnostics; + + for (uint i = 0; i < numDiagnostics; ++i) + { + var diagnostic = translationUnit.GetDiagnostic(i); + Console.WriteLine(diagnostic.Spelling.ToString()); + diagnostic.Dispose(); + } } - } - - translationUnits.Add(translationUnit); - } - - using (var sw = new StreamWriter(outputFile)) - { - sw.NewLine = "\n"; - - sw.WriteLine("namespace " + config.Namespace); - sw.WriteLine("{"); - - sw.WriteLine(" using System;"); - sw.WriteLine(" using System.Runtime.InteropServices;"); - sw.WriteLine(); - - var writer = new CursorWriter(config, sw, indentation: 1, (cursor) => cursor.Kind != CXCursorKind.CXCursor_FunctionDecl); - foreach (var tu in translationUnits) - { - tu.Cursor.VisitChildren(writer.VisitTranslationUnit, clientData: default); - } - - sw.Write(" public static "); - - if (config.GenerateUnsafeCode) - { - sw.Write("unsafe "); - } - sw.WriteLine("partial class " + config.MethodClassName); - sw.WriteLine(" {"); - { - var functionDeclWriter = new CursorWriter(config, sw, indentation: 2, (cursor) => cursor.Kind == CXCursorKind.CXCursor_FunctionDecl); - - sw.WriteLine($" private const string libraryPath = \"{config.LibraryPath}\";"); - sw.WriteLine(); - - foreach (var tu in translationUnits) + using (translationUnit) { - tu.Cursor.VisitChildren(functionDeclWriter.VisitTranslationUnit, new CXClientData(IntPtr.Zero)); + translationUnit.Cursor.VisitChildren(writer.VisitTranslationUnit, clientData: default); } } - sw.WriteLine(" }"); - sw.WriteLine("}"); - } - - foreach (var tu in translationUnits) - { - tu.Dispose(); } - createIndex.Dispose(); return 0; } @@ -298,7 +253,7 @@ private static void AddOutputOption(RootCommand rootCommand) argument.Name = "file"; argument.SetDefaultValue(string.Empty); - var option = new Option("--output", "The output file to write the generated bindings to.", argument); + var option = new Option("--output", "The output location to write the generated bindings to.", argument); option.AddAlias("--o"); rootCommand.AddOption(option); diff --git a/ClangSharpPInvokeGenerator/Properties/launchSettings.json b/ClangSharpPInvokeGenerator/Properties/launchSettings.json index f652090b..5de9f0e2 100644 --- a/ClangSharpPInvokeGenerator/Properties/launchSettings.json +++ b/ClangSharpPInvokeGenerator/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "Regenerate ClangSharp": { "commandName": "Project", - "commandLineArgs": "--m clang --p clang_ --namespace ClangSharp --output \"../../../../ClangSharp/Generated.cs\" --libraryPath \"$(LibClangName)\" --include \"$(LLVMIncludePath)\" --file \"$(LLVMIncludePath)/clang-c/Index.h\" --file \"$(LLVMIncludePath)/clang-c/CXString.h\" --file \"$(LLVMIncludePath)/clang-c/Documentation.h\" --file \"$(LLVMIncludePath)/clang-c/CXErrorCode.h\" --file \"$(LLVMIncludePath)/clang-c/BuildSystem.h\" --file \"$(LLVMIncludePath)/clang-c/CXCompilationDatabase.h\" --e clang_index_getClientEntity --e clang_index_setClientEntity --e clang_createTranslationUnitFromSourceFile --e clang_parseTranslationUnit --e clang_parseTranslationUnit2 --e clang_parseTranslationUnit2FullArgv --e clang_reparseTranslationUnit --e clang_codeCompleteAt --e clang_indexSourceFile --e clang_indexSourceFileFullArgv --e clang_disposeSourceRangeList --e clang_annotateTokens --e clang_annotateTokens --e clang_disposeTokens --e clang_tokenize --e clang_disposeStringSet --e clang_getCompletionParent --e clang_disposeCXPlatformAvailability --e clang_getCursorPlatformAvailability" + "commandLineArgs": "--m clang --p clang_ --namespace ClangSharp --output \"../../../../ClangSharp/Generated/\" --config multi-file --libraryPath \"$(LibClangName)\" --include \"$(LLVMIncludePath)\" --file \"$(LLVMIncludePath)/clang-c/Index.h\" --file \"$(LLVMIncludePath)/clang-c/CXString.h\" --file \"$(LLVMIncludePath)/clang-c/Documentation.h\" --file \"$(LLVMIncludePath)/clang-c/CXErrorCode.h\" --file \"$(LLVMIncludePath)/clang-c/BuildSystem.h\" --file \"$(LLVMIncludePath)/clang-c/CXCompilationDatabase.h\" --e clang_index_getClientEntity --e clang_index_setClientEntity --e clang_createTranslationUnitFromSourceFile --e clang_parseTranslationUnit --e clang_parseTranslationUnit2 --e clang_parseTranslationUnit2FullArgv --e clang_reparseTranslationUnit --e clang_codeCompleteAt --e clang_indexSourceFile --e clang_indexSourceFileFullArgv --e clang_disposeSourceRangeList --e clang_annotateTokens --e clang_annotateTokens --e clang_disposeTokens --e clang_tokenize --e clang_disposeStringSet --e clang_getCompletionParent --e clang_disposeCXPlatformAvailability --e clang_getCursorPlatformAvailability" } } } \ No newline at end of file