From dc6d9e97249d31423bd60f9a501a145a36c3c102 Mon Sep 17 00:00:00 2001 From: "denis.zaporozhets" Date: Mon, 11 May 2026 14:51:37 +0300 Subject: [PATCH 1/3] improvements to the code generation --- .../StructWrappers/IndexerCallbacks.cs | 4 +- .../StructWrappers/QBCodeCompleteResults.cs | 4 +- .../Generated/StructWrappers/QBComment.cs | 4 +- .../StructWrappers/QBCompletionResult.cs | 4 +- .../Generated/StructWrappers/QBCursor.cs | 4 +- .../StructWrappers/QBCursorAndRangeVisitor.cs | 4 +- .../StructWrappers/QBFileUniqueID.cs | 4 +- .../Generated/StructWrappers/QBIdxAttrInfo.cs | 4 +- .../StructWrappers/QBIdxBaseClassInfo.cs | 4 +- .../StructWrappers/QBIdxCXXClassDeclInfo.cs | 4 +- .../StructWrappers/QBIdxContainerInfo.cs | 4 +- .../Generated/StructWrappers/QBIdxDeclInfo.cs | 4 +- .../StructWrappers/QBIdxEntityInfo.cs | 4 +- .../StructWrappers/QBIdxEntityRefInfo.cs | 4 +- .../QBIdxIBOutletCollectionAttrInfo.cs | 4 +- .../QBIdxImportedASTFileInfo.cs | 4 +- .../StructWrappers/QBIdxIncludedFileInfo.cs | 4 +- .../Generated/StructWrappers/QBIdxLoc.cs | 4 +- .../QBIdxObjCCategoryDeclInfo.cs | 4 +- .../QBIdxObjCContainerDeclInfo.cs | 4 +- .../QBIdxObjCInterfaceDeclInfo.cs | 4 +- .../QBIdxObjCPropertyDeclInfo.cs | 4 +- .../QBIdxObjCProtocolRefInfo.cs | 4 +- .../QBIdxObjCProtocolRefListInfo.cs | 4 +- .../StructWrappers/QBIndexOptions.cs | 4 +- .../StructWrappers/QBPlatformAvailability.cs | 4 +- .../StructWrappers/QBSourceLocation.cs | 4 +- .../Generated/StructWrappers/QBSourceRange.cs | 4 +- .../StructWrappers/QBSourceRangeList.cs | 4 +- .../Generated/StructWrappers/QBString.cs | 4 +- .../Generated/StructWrappers/QBStringSet.cs | 4 +- .../StructWrappers/QBTUResourceUsage.cs | 4 +- .../StructWrappers/QBTUResourceUsageEntry.cs | 4 +- .../Generated/StructWrappers/QBToken.cs | 4 +- .../Generated/StructWrappers/QBType.cs | 4 +- .../Generated/StructWrappers/QBUnsavedFile.cs | 4 +- .../Generated/StructWrappers/QBVersion.cs | 4 +- .../StructWrappers/IndexerCallbacks.cs | 4 +- .../StructWrappers/QBCodeCompleteResults.cs | 4 +- .../Generated/StructWrappers/QBComment.cs | 4 +- .../StructWrappers/QBCompletionResult.cs | 4 +- .../Generated/StructWrappers/QBCursor.cs | 4 +- .../StructWrappers/QBCursorAndRangeVisitor.cs | 4 +- .../StructWrappers/QBFileUniqueID.cs | 4 +- .../Generated/StructWrappers/QBIdxAttrInfo.cs | 4 +- .../StructWrappers/QBIdxBaseClassInfo.cs | 4 +- .../StructWrappers/QBIdxCXXClassDeclInfo.cs | 4 +- .../StructWrappers/QBIdxContainerInfo.cs | 4 +- .../Generated/StructWrappers/QBIdxDeclInfo.cs | 4 +- .../StructWrappers/QBIdxEntityInfo.cs | 4 +- .../StructWrappers/QBIdxEntityRefInfo.cs | 4 +- .../QBIdxIBOutletCollectionAttrInfo.cs | 4 +- .../QBIdxImportedASTFileInfo.cs | 4 +- .../StructWrappers/QBIdxIncludedFileInfo.cs | 4 +- .../Generated/StructWrappers/QBIdxLoc.cs | 4 +- .../QBIdxObjCCategoryDeclInfo.cs | 4 +- .../QBIdxObjCContainerDeclInfo.cs | 4 +- .../QBIdxObjCInterfaceDeclInfo.cs | 4 +- .../QBIdxObjCPropertyDeclInfo.cs | 4 +- .../QBIdxObjCProtocolRefInfo.cs | 4 +- .../QBIdxObjCProtocolRefListInfo.cs | 4 +- .../StructWrappers/QBIndexOptions.cs | 4 +- .../StructWrappers/QBPlatformAvailability.cs | 4 +- .../StructWrappers/QBSourceLocation.cs | 4 +- .../Generated/StructWrappers/QBSourceRange.cs | 4 +- .../StructWrappers/QBSourceRangeList.cs | 4 +- .../Generated/StructWrappers/QBString.cs | 4 +- .../Generated/StructWrappers/QBStringSet.cs | 4 +- .../StructWrappers/QBTUResourceUsage.cs | 4 +- .../StructWrappers/QBTUResourceUsageEntry.cs | 4 +- .../Generated/StructWrappers/QBToken.cs | 4 +- .../Generated/StructWrappers/QBType.cs | 4 +- .../Generated/StructWrappers/QBUnsavedFile.cs | 4 +- .../Generated/StructWrappers/QBVersion.cs | 4 +- QuantumBinding.Generator/AST/Class.cs | 11 + QuantumBinding.Generator/AST/Declaration.cs | 2 +- .../AST/DeclarationUnit.cs | 62 ++-- QuantumBinding.Generator/AST/Delegate.cs | 14 +- QuantumBinding.Generator/AST/DispatchTable.cs | 51 +++ QuantumBinding.Generator/AST/Enumeration.cs | 2 +- QuantumBinding.Generator/AST/Field.cs | 19 +- QuantumBinding.Generator/AST/Function.cs | 13 + .../AST/GlobalUsingItem.cs | 28 ++ QuantumBinding.Generator/AST/GlobalUsings.cs | 41 +++ QuantumBinding.Generator/AST/Macro.cs | 2 + QuantumBinding.Generator/AST/Metadata.cs | 22 ++ QuantumBinding.Generator/AST/Parameter.cs | 3 + .../BindingsMapping/ArrayTypeMap.cs | 9 +- .../BindingsMapping/BindingTypeMap.cs | 3 - QuantumBinding.Generator/CSharpTypePrinter.cs | 104 +++++-- .../CodeGeneration/CSharpCodeGenerator.cs | 47 ++- .../CodeGeneration/CSharpCodeGeneratorBase.cs | 5 + .../CodeGeneration/CodeBlockKind.cs | 3 +- .../CodeGeneration/CsFilesFileGenerator.cs | 3 +- .../CodeGeneration/GeneratorCategory.cs | 4 +- .../GeneratorSpecializations.cs | 4 +- .../MarshalContextToFunctionCodeGenerator.cs | 248 +++++++++++---- .../MethodToFunctionCodeGenerator.cs | 48 ++- .../MethodToRefStructCodeGenerator.cs | 14 +- .../CodeGeneration/TextGenerator.cs | 1 + .../CodeGeneration/WrapperGenerator.cs | 291 ++++++++++++------ .../Extensions/StringExtensions.cs | 47 +++ QuantumBinding.Generator/FileLocation.cs | 8 + .../IDeclarationVisitor.cs | 3 + .../Parser/Clang/ClangParser.cs | 10 +- .../Parser/IMetadataProvider.cs | 2 +- QuantumBinding.Generator/PrimitiveType.cs | 4 +- .../PostProcessingApi.Classes.cs | 2 +- .../Processors/BasicCodeGeneratorPass.cs | 4 + .../Processors/CheckMacrosPass.cs | 10 +- .../Processors/DispatchTableProcessorPass.cs | 46 +++ .../Processors/EnumItemsCleanupPass.cs | 8 - .../Processors/EnumItemsRenamePass.cs | 56 ++-- .../FunctionToInstanceMethodPass.cs | 65 ++-- .../Processors/LoadBindingsFromFilePass.cs | 2 +- .../Processors/NormalizeParametersPass.cs | 58 ++-- .../Processors/PreGeneratorOptions.cs | 3 + .../Processors/PreGeneratorPass.cs | 39 ++- .../UpdateWrappedMethodParametersPass.cs | 15 +- ...nPass.cs => WrappersCodeGenerationPass.cs} | 6 +- .../Processors/WrappersCreationPass.cs | 7 +- .../QuantumBindingGenerator.cs | 4 +- QuantumBinding.Generator/TypePrinter.cs | 7 + QuantumBinding.Generator/Types/ArrayType.cs | 8 +- QuantumBinding.Generator/Types/BindingType.cs | 1 + .../Types/DispatchTableType.cs | 24 ++ .../Types/ITypeVisitor.cs | 2 +- QuantumBinding.Generator/Types/PointerType.cs | 10 + QuantumBinding.Generator/Types/TypeUtil.cs | 10 +- .../Utils/DeclarationUtils.cs | 4 + QuantumBinding.Utils/IMarshallable.cs | 4 +- QuantumBinding.Utils/MarshalContextUtils.cs | 24 +- 132 files changed, 1335 insertions(+), 508 deletions(-) create mode 100644 QuantumBinding.Generator/AST/DispatchTable.cs create mode 100644 QuantumBinding.Generator/AST/GlobalUsingItem.cs create mode 100644 QuantumBinding.Generator/AST/GlobalUsings.cs create mode 100644 QuantumBinding.Generator/AST/Metadata.cs create mode 100644 QuantumBinding.Generator/Extensions/StringExtensions.cs create mode 100644 QuantumBinding.Generator/Processors/DispatchTableProcessorPass.cs rename QuantumBinding.Generator/Processors/{WrappersGenerationPass.cs => WrappersCodeGenerationPass.cs} (89%) mode change 100755 => 100644 create mode 100644 QuantumBinding.Generator/Types/DispatchTableType.cs diff --git a/QuantumBinding.Clang/Generated/StructWrappers/IndexerCallbacks.cs b/QuantumBinding.Clang/Generated/StructWrappers/IndexerCallbacks.cs index 5218a33..8e1e2a4 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/IndexerCallbacks.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/IndexerCallbacks.cs @@ -60,14 +60,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.IndexerCallbacks native) IndexEntityReference = native.indexEntityReference; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct IndexerCallbacksMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBCodeCompleteResults.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBCodeCompleteResults.cs index 3543da5..785714f 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBCodeCompleteResults.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBCodeCompleteResults.cs @@ -105,14 +105,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXCodeCompleteResults na NumResults = native.numResults; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXCodeCompleteResultsMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBComment.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBComment.cs index b62ba0c..cf737a0 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBComment.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBComment.cs @@ -378,14 +378,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXComment native) TranslationUnit = new QBTranslationUnit(native.translationUnit); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXCommentMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBCompletionResult.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBCompletionResult.cs index 0a7c9e5..092a6e7 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBCompletionResult.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBCompletionResult.cs @@ -48,14 +48,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXCompletionResult nativ CompletionString = new QBCompletionString(native.completionString); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXCompletionResultMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBCursor.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBCursor.cs index d0c6199..bb4408b 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBCursor.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBCursor.cs @@ -1500,14 +1500,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXCursor native) Data = tmpData; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXCursorMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBCursorAndRangeVisitor.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBCursorAndRangeVisitor.cs index 31095ed..6e80799 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBCursorAndRangeVisitor.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBCursorAndRangeVisitor.cs @@ -48,14 +48,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXCursorAndRangeVisitor Visit = native.visit; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXCursorAndRangeVisitorMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBFileUniqueID.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBFileUniqueID.cs index 4ca962e..8f3d32c 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBFileUniqueID.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBFileUniqueID.cs @@ -49,14 +49,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXFileUniqueID native) Data = tmpData; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXFileUniqueIDMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxAttrInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxAttrInfo.cs index 2d505a5..cb7e358 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxAttrInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxAttrInfo.cs @@ -50,14 +50,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxAttrInfo native) Loc = new QBIdxLoc(native.loc); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxAttrInfoMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxBaseClassInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxBaseClassInfo.cs index f7cb77f..401ab50 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxBaseClassInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxBaseClassInfo.cs @@ -55,14 +55,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxBaseClassInfo nativ Loc = new QBIdxLoc(native.loc); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxBaseClassInfoMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxCXXClassDeclInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxCXXClassDeclInfo.cs index 8baa233..834eb6f 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxCXXClassDeclInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxCXXClassDeclInfo.cs @@ -72,14 +72,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxCXXClassDeclInfo na NumBases = native.numBases; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxCXXClassDeclInfoMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxContainerInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxContainerInfo.cs index c5589f0..d6d53d5 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxContainerInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxContainerInfo.cs @@ -46,14 +46,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxContainerInfo nativ Cursor = new QBCursor(native.cursor); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxContainerInfoMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxDeclInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxDeclInfo.cs index 63308d6..dad709c 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxDeclInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxDeclInfo.cs @@ -107,14 +107,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxDeclInfo native) Flags = native.flags; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxDeclInfoMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxEntityInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxEntityInfo.cs index aeae0f1..b2a9c42 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxEntityInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxEntityInfo.cs @@ -81,14 +81,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxEntityInfo native) NumAttributes = native.numAttributes; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxEntityInfoMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxEntityRefInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxEntityRefInfo.cs index 2fcc3a8..19cfc57 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxEntityRefInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxEntityRefInfo.cs @@ -73,14 +73,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxEntityRefInfo nativ Role = native.role; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxEntityRefInfoMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxIBOutletCollectionAttrInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxIBOutletCollectionAttrInfo.cs index 83b34ee..9acc08a 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxIBOutletCollectionAttrInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxIBOutletCollectionAttrInfo.cs @@ -62,14 +62,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxIBOutletCollectionA ClassLoc = new QBIdxLoc(native.classLoc); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxIBOutletCollectionAttrInfoMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxImportedASTFileInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxImportedASTFileInfo.cs index fdf8663..7cb430c 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxImportedASTFileInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxImportedASTFileInfo.cs @@ -52,14 +52,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxImportedASTFileInfo IsImplicit = native.isImplicit; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxImportedASTFileInfoMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxIncludedFileInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxIncludedFileInfo.cs index aa7b6fc..089f4a9 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxIncludedFileInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxIncludedFileInfo.cs @@ -58,14 +58,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxIncludedFileInfo na IsModuleImport = native.isModuleImport; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxIncludedFileInfoMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxLoc.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxLoc.cs index 1fb47a4..3780d9c 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxLoc.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxLoc.cs @@ -77,14 +77,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxLoc native) Int_data = native.int_data; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxLocMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCCategoryDeclInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCCategoryDeclInfo.cs index 4a5c9a4..4ac8f48 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCCategoryDeclInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCCategoryDeclInfo.cs @@ -69,14 +69,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxObjCCategoryDeclInf NativeUtils.Free(native.protocols); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxObjCCategoryDeclInfoMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCContainerDeclInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCContainerDeclInfo.cs index 33a2e7d..9c28420 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCContainerDeclInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCContainerDeclInfo.cs @@ -53,14 +53,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxObjCContainerDeclIn Kind = native.kind; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxObjCContainerDeclInfoMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCInterfaceDeclInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCInterfaceDeclInfo.cs index 0524809..bcadf80 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCInterfaceDeclInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCInterfaceDeclInfo.cs @@ -65,14 +65,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxObjCInterfaceDeclIn NativeUtils.Free(native.protocols); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxObjCInterfaceDeclInfoMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCPropertyDeclInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCPropertyDeclInfo.cs index 86eeafc..00acaba 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCPropertyDeclInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCPropertyDeclInfo.cs @@ -65,14 +65,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxObjCPropertyDeclInf NativeUtils.Free(native.setter); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxObjCPropertyDeclInfoMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCProtocolRefInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCProtocolRefInfo.cs index 435fb52..79a25c6 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCProtocolRefInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCProtocolRefInfo.cs @@ -55,14 +55,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxObjCProtocolRefInfo Loc = new QBIdxLoc(native.loc); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxObjCProtocolRefInfoMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCProtocolRefListInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCProtocolRefListInfo.cs index 4c44c5e..472a3b7 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCProtocolRefListInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCProtocolRefListInfo.cs @@ -65,14 +65,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxObjCProtocolRefList NumProtocols = native.numProtocols; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxObjCProtocolRefListInfoMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIndexOptions.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIndexOptions.cs index 6f3778c..589aacc 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIndexOptions.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIndexOptions.cs @@ -66,14 +66,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIndexOptions native) InvocationEmissionPath = new string(native.invocationEmissionPath); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIndexOptionsMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBPlatformAvailability.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBPlatformAvailability.cs index b817a75..54663b2 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBPlatformAvailability.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBPlatformAvailability.cs @@ -66,14 +66,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXPlatformAvailability n Message = new QBString(native.message); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXPlatformAvailabilityMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBSourceLocation.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBSourceLocation.cs index df4748d..8e7117c 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBSourceLocation.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBSourceLocation.cs @@ -229,14 +229,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXSourceLocation native) Int_data = native.int_data; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXSourceLocationMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBSourceRange.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBSourceRange.cs index fa099c1..9001e84 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBSourceRange.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBSourceRange.cs @@ -117,14 +117,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXSourceRange native) End_int_data = native.end_int_data; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXSourceRangeMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBSourceRangeList.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBSourceRangeList.cs index d55a969..b7a9d45 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBSourceRangeList.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBSourceRangeList.cs @@ -63,14 +63,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXSourceRangeList native NativeUtils.Free(native.ranges); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXSourceRangeListMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBString.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBString.cs index 0a7662e..7c54aa9 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBString.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBString.cs @@ -69,14 +69,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXString native) Private_flags = native.private_flags; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXStringMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBStringSet.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBStringSet.cs index 2c0689b..4ecca26 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBStringSet.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBStringSet.cs @@ -63,14 +63,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXStringSet native) Count = native.count; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXStringSetMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBTUResourceUsage.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBTUResourceUsage.cs index daf187a..d6f06d5 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBTUResourceUsage.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBTUResourceUsage.cs @@ -62,14 +62,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXTUResourceUsage native NativeUtils.Free(native.entries); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXTUResourceUsageMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBTUResourceUsageEntry.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBTUResourceUsageEntry.cs index 98c1b1a..fb9ca82 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBTUResourceUsageEntry.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBTUResourceUsageEntry.cs @@ -48,14 +48,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXTUResourceUsageEntry n Amount = native.amount; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXTUResourceUsageEntryMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBToken.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBToken.cs index 52d24b7..739e40b 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBToken.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBToken.cs @@ -61,14 +61,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXToken native) Ptr_data = native.ptr_data; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXTokenMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBType.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBType.cs index 4043c40..13112c0 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBType.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBType.cs @@ -562,14 +562,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXType native) Data = tmpData; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXTypeMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBUnsavedFile.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBUnsavedFile.cs index 423c187..dd0806f 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBUnsavedFile.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBUnsavedFile.cs @@ -54,14 +54,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXUnsavedFile native) Length = native.length; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXUnsavedFileMarshaller { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBVersion.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBVersion.cs index b6a0685..c19ce3d 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBVersion.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBVersion.cs @@ -50,14 +50,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXVersion native) Subminor = native.subminor; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXVersionMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/IndexerCallbacks.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/IndexerCallbacks.cs index 5218a33..8e1e2a4 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/IndexerCallbacks.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/IndexerCallbacks.cs @@ -60,14 +60,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.IndexerCallbacks native) IndexEntityReference = native.indexEntityReference; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct IndexerCallbacksMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCodeCompleteResults.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCodeCompleteResults.cs index 3543da5..785714f 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCodeCompleteResults.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCodeCompleteResults.cs @@ -105,14 +105,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXCodeCompleteResults na NumResults = native.numResults; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXCodeCompleteResultsMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBComment.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBComment.cs index b62ba0c..cf737a0 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBComment.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBComment.cs @@ -378,14 +378,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXComment native) TranslationUnit = new QBTranslationUnit(native.translationUnit); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXCommentMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCompletionResult.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCompletionResult.cs index 0a7c9e5..092a6e7 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCompletionResult.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCompletionResult.cs @@ -48,14 +48,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXCompletionResult nativ CompletionString = new QBCompletionString(native.completionString); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXCompletionResultMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCursor.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCursor.cs index d0c6199..bb4408b 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCursor.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCursor.cs @@ -1500,14 +1500,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXCursor native) Data = tmpData; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXCursorMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCursorAndRangeVisitor.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCursorAndRangeVisitor.cs index 31095ed..6e80799 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCursorAndRangeVisitor.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCursorAndRangeVisitor.cs @@ -48,14 +48,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXCursorAndRangeVisitor Visit = native.visit; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXCursorAndRangeVisitorMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBFileUniqueID.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBFileUniqueID.cs index 4ca962e..8f3d32c 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBFileUniqueID.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBFileUniqueID.cs @@ -49,14 +49,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXFileUniqueID native) Data = tmpData; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXFileUniqueIDMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxAttrInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxAttrInfo.cs index 2d505a5..cb7e358 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxAttrInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxAttrInfo.cs @@ -50,14 +50,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxAttrInfo native) Loc = new QBIdxLoc(native.loc); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxAttrInfoMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxBaseClassInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxBaseClassInfo.cs index f7cb77f..401ab50 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxBaseClassInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxBaseClassInfo.cs @@ -55,14 +55,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxBaseClassInfo nativ Loc = new QBIdxLoc(native.loc); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxBaseClassInfoMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxCXXClassDeclInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxCXXClassDeclInfo.cs index 8baa233..834eb6f 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxCXXClassDeclInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxCXXClassDeclInfo.cs @@ -72,14 +72,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxCXXClassDeclInfo na NumBases = native.numBases; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxCXXClassDeclInfoMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxContainerInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxContainerInfo.cs index c5589f0..d6d53d5 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxContainerInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxContainerInfo.cs @@ -46,14 +46,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxContainerInfo nativ Cursor = new QBCursor(native.cursor); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxContainerInfoMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxDeclInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxDeclInfo.cs index 63308d6..dad709c 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxDeclInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxDeclInfo.cs @@ -107,14 +107,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxDeclInfo native) Flags = native.flags; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxDeclInfoMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxEntityInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxEntityInfo.cs index aeae0f1..b2a9c42 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxEntityInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxEntityInfo.cs @@ -81,14 +81,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxEntityInfo native) NumAttributes = native.numAttributes; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxEntityInfoMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxEntityRefInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxEntityRefInfo.cs index 2fcc3a8..19cfc57 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxEntityRefInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxEntityRefInfo.cs @@ -73,14 +73,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxEntityRefInfo nativ Role = native.role; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxEntityRefInfoMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxIBOutletCollectionAttrInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxIBOutletCollectionAttrInfo.cs index 83b34ee..9acc08a 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxIBOutletCollectionAttrInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxIBOutletCollectionAttrInfo.cs @@ -62,14 +62,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxIBOutletCollectionA ClassLoc = new QBIdxLoc(native.classLoc); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxIBOutletCollectionAttrInfoMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxImportedASTFileInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxImportedASTFileInfo.cs index fdf8663..7cb430c 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxImportedASTFileInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxImportedASTFileInfo.cs @@ -52,14 +52,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxImportedASTFileInfo IsImplicit = native.isImplicit; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxImportedASTFileInfoMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxIncludedFileInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxIncludedFileInfo.cs index aa7b6fc..089f4a9 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxIncludedFileInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxIncludedFileInfo.cs @@ -58,14 +58,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxIncludedFileInfo na IsModuleImport = native.isModuleImport; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxIncludedFileInfoMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxLoc.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxLoc.cs index 1fb47a4..3780d9c 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxLoc.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxLoc.cs @@ -77,14 +77,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxLoc native) Int_data = native.int_data; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxLocMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCCategoryDeclInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCCategoryDeclInfo.cs index 4a5c9a4..4ac8f48 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCCategoryDeclInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCCategoryDeclInfo.cs @@ -69,14 +69,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxObjCCategoryDeclInf NativeUtils.Free(native.protocols); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxObjCCategoryDeclInfoMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCContainerDeclInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCContainerDeclInfo.cs index 33a2e7d..9c28420 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCContainerDeclInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCContainerDeclInfo.cs @@ -53,14 +53,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxObjCContainerDeclIn Kind = native.kind; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxObjCContainerDeclInfoMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCInterfaceDeclInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCInterfaceDeclInfo.cs index 0524809..bcadf80 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCInterfaceDeclInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCInterfaceDeclInfo.cs @@ -65,14 +65,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxObjCInterfaceDeclIn NativeUtils.Free(native.protocols); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxObjCInterfaceDeclInfoMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCPropertyDeclInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCPropertyDeclInfo.cs index 86eeafc..00acaba 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCPropertyDeclInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCPropertyDeclInfo.cs @@ -65,14 +65,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxObjCPropertyDeclInf NativeUtils.Free(native.setter); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxObjCPropertyDeclInfoMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCProtocolRefInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCProtocolRefInfo.cs index 435fb52..79a25c6 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCProtocolRefInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCProtocolRefInfo.cs @@ -55,14 +55,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxObjCProtocolRefInfo Loc = new QBIdxLoc(native.loc); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxObjCProtocolRefInfoMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCProtocolRefListInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCProtocolRefListInfo.cs index 4c44c5e..472a3b7 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCProtocolRefListInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCProtocolRefListInfo.cs @@ -65,14 +65,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIdxObjCProtocolRefList NumProtocols = native.numProtocols; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIdxObjCProtocolRefListInfoMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIndexOptions.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIndexOptions.cs index 6f3778c..589aacc 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIndexOptions.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIndexOptions.cs @@ -66,14 +66,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXIndexOptions native) InvocationEmissionPath = new string(native.invocationEmissionPath); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXIndexOptionsMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBPlatformAvailability.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBPlatformAvailability.cs index b817a75..54663b2 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBPlatformAvailability.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBPlatformAvailability.cs @@ -66,14 +66,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXPlatformAvailability n Message = new QBString(native.message); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXPlatformAvailabilityMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceLocation.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceLocation.cs index df4748d..8e7117c 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceLocation.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceLocation.cs @@ -229,14 +229,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXSourceLocation native) Int_data = native.int_data; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXSourceLocationMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceRange.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceRange.cs index fa099c1..9001e84 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceRange.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceRange.cs @@ -117,14 +117,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXSourceRange native) End_int_data = native.end_int_data; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXSourceRangeMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceRangeList.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceRangeList.cs index d55a969..b7a9d45 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceRangeList.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceRangeList.cs @@ -63,14 +63,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXSourceRangeList native NativeUtils.Free(native.ranges); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXSourceRangeListMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBString.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBString.cs index 0a7662e..7c54aa9 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBString.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBString.cs @@ -69,14 +69,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXString native) Private_flags = native.private_flags; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXStringMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBStringSet.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBStringSet.cs index 2c0689b..4ecca26 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBStringSet.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBStringSet.cs @@ -63,14 +63,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXStringSet native) Count = native.count; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXStringSetMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBTUResourceUsage.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBTUResourceUsage.cs index daf187a..d6f06d5 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBTUResourceUsage.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBTUResourceUsage.cs @@ -62,14 +62,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXTUResourceUsage native NativeUtils.Free(native.entries); } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXTUResourceUsageMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBTUResourceUsageEntry.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBTUResourceUsageEntry.cs index 98c1b1a..fb9ca82 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBTUResourceUsageEntry.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBTUResourceUsageEntry.cs @@ -48,14 +48,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXTUResourceUsageEntry n Amount = native.amount; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXTUResourceUsageEntryMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBToken.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBToken.cs index 52d24b7..739e40b 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBToken.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBToken.cs @@ -61,14 +61,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXToken native) Ptr_data = native.ptr_data; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXTokenMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBType.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBType.cs index 4043c40..13112c0 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBType.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBType.cs @@ -562,14 +562,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXType native) Data = tmpData; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXTypeMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBUnsavedFile.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBUnsavedFile.cs index 423c187..dd0806f 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBUnsavedFile.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBUnsavedFile.cs @@ -54,14 +54,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXUnsavedFile native) Length = native.length; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXUnsavedFileMarshaller { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBVersion.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBVersion.cs index b6a0685..c19ce3d 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBVersion.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBVersion.cs @@ -50,14 +50,14 @@ public void MarshalFrom(in QuantumBinding.Clang.Interop.CXVersion native) Subminor = native.subminor; } - public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct + public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct { var nativeSpan = context.AllocateNative(1); var dataCursor = context.GetDataCursor(); var internalContext = new MarshallingContext(nativeSpan, dataCursor); this.MarshalTo(ref internalContext); context.SetDataCursor(internalContext.DataCursor); - return (nuint)System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); + return System.Runtime.CompilerServices.Unsafe.AsPointer(ref nativeSpan[0]); } private ref struct CXVersionMarshaller { diff --git a/QuantumBinding.Generator/AST/Class.cs b/QuantumBinding.Generator/AST/Class.cs index b402324..4886491 100755 --- a/QuantumBinding.Generator/AST/Class.cs +++ b/QuantumBinding.Generator/AST/Class.cs @@ -35,6 +35,14 @@ public Class() public string InputClassName {get; set;} public Class LinkedTo { get; set; } + + public bool IsDispatchable { get; set; } + + public DispatchTable DispatchTable { get; set; } + + public bool IsDispatchTableOwner => DispatchTable != null && DispatchTable.TableOwner == this; + + public string DispatchFieldName => "Commands"; // True if the record is a POD (Plain Old Data) type. public bool IsSimpleType { get; set; } @@ -191,6 +199,9 @@ public override object Clone() NativeStructFieldName = NativeStructFieldName, ExtendedFrom = ExtendedFrom, interfaces = [..Interfaces], + Comment = (Comment)Comment?.Clone(), + IsDispatchable = IsDispatchable, + DispatchTable = DispatchTable }; } diff --git a/QuantumBinding.Generator/AST/Declaration.cs b/QuantumBinding.Generator/AST/Declaration.cs index c4d6a0c..80d1cc7 100755 --- a/QuantumBinding.Generator/AST/Declaration.cs +++ b/QuantumBinding.Generator/AST/Declaration.cs @@ -10,7 +10,7 @@ protected Declaration() Id = Guid.NewGuid().ToString(); } - public string Name { get; set; } + public string Name { get; set; } = string.Empty; public string FullName => string.IsNullOrEmpty(Namespace) ? Name : $"{Namespace}.{Name}"; diff --git a/QuantumBinding.Generator/AST/DeclarationUnit.cs b/QuantumBinding.Generator/AST/DeclarationUnit.cs index 6a8de43..fe4f6e6 100755 --- a/QuantumBinding.Generator/AST/DeclarationUnit.cs +++ b/QuantumBinding.Generator/AST/DeclarationUnit.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Collections.ObjectModel; using System.Linq; using QuantumBinding.Generator.CodeGeneration; using QuantumBinding.Generator.Types; @@ -11,7 +10,7 @@ public abstract class DeclarationUnit : Declaration { protected DeclarationUnit() { - declarations = new List(); + _declarations = new List(); Namespaces = new List(); } @@ -20,16 +19,20 @@ static DeclarationUnit() DummyTypes = new Dictionary(); } - private List declarations; + private List _declarations; public List Namespaces { get; private set; } + + public IReadOnlyList GlobalUsings => _declarations.Where(x => x is GlobalUsings).OfType().ToList(); + + public IReadOnlyList DispatchTables => _declarations.Where(x => x is DispatchTable).OfType().ToList(); - public IReadOnlyList Macros => declarations.Where(x => x is Macro).Cast().ToList(); + public IReadOnlyList Macros => _declarations.Where(x => x is Macro).OfType().ToList(); public IReadOnlyList Enums => - declarations.Where(x => x is Enumeration).Cast().ToList(); + _declarations.Where(x => x is Enumeration).OfType().ToList(); - public IReadOnlyList AllClasses => declarations.Where(x => x is Class).Cast().ToList(); + public IReadOnlyList AllClasses => _declarations.Where(x => x is Class).OfType().ToList(); public IReadOnlyList Classes => AllClasses.Where(x => x.ClassType == ClassType.Class).ToList(); @@ -49,17 +52,17 @@ static DeclarationUnit() public IReadOnlyList ExtensionClasses => TranslationUnitsPool.SelectMany(x => x.Classes) .Where(x => x.HasExtensions && x.ExtensionMethods.Any(z => z.Owner == this)).ToList(); - public IReadOnlyList Delegates => declarations.Where(x => x is Delegate).Cast().ToList(); + public IReadOnlyList Delegates => _declarations.Where(x => x is Delegate).OfType().ToList(); public IReadOnlyList Functions => - declarations.Where(x => x is Function && !(x is Method)).Cast().ToList(); + _declarations.Where(x => x is Function && !(x is Method)).OfType().ToList(); - public IReadOnlyList StaticMethods => declarations.Where(x => x is Method).Cast().ToList(); + public IReadOnlyList StaticMethods => _declarations.Where(x => x is Method).OfType().ToList(); - public IReadOnlyList Declarations => declarations; + public IReadOnlyList Declarations => _declarations; public IReadOnlyList IgnoredDeclarations => - declarations.Where(x => x.IsIgnored).ToList(); + _declarations.Where(x => x.IsIgnored).ToList(); public static Dictionary DummyTypes { get; } @@ -69,7 +72,7 @@ static DeclarationUnit() private bool IsUnitEmpty() { - return (declarations.Count == 0 || declarations.Except(IgnoredDeclarations).ToList().Count == 0) && + return (_declarations.Count == 0 || _declarations.Except(IgnoredDeclarations).ToList().Count == 0) && ExtensionClasses.Count == 0; } @@ -115,6 +118,12 @@ public bool IsSpecializationsAvailable(GeneratorSpecializations specializations) case GeneratorSpecializations.ExtensionMethods: isAvailable |= ExtensionClasses.Count > 0; break; + case GeneratorSpecializations.GlobalUsings: + isAvailable |= GlobalUsings.Count > 0; + break; + case GeneratorSpecializations.DispatchTables: + isAvailable |= DispatchTables.Count > 0; + break; } } @@ -123,10 +132,7 @@ public bool IsSpecializationsAvailable(GeneratorSpecializations specializations) public void AddDummyType(string dummyType, string originalType) { - if (!DummyTypes.ContainsKey(dummyType)) - { - DummyTypes.Add(dummyType, originalType); - } + DummyTypes.TryAdd(dummyType, originalType); } public DeclarationUnit FindNamespace(string @namespace) @@ -138,7 +144,7 @@ public void RemoveClasses(Class[] classes) { for (int i = 0; i < classes.Length; ++i) { - declarations.Remove(classes[i]); + _declarations.Remove(classes[i]); } } @@ -150,7 +156,7 @@ public IEnumerable FindDeclarationsBySourceLocation(string fileName { var decls = Declarations.Where(x => x.Location.FileNameWithoutExtension == fileName).ToList(); declsOutput.AddRange(decls); - declarations = Declarations.Except(decls).ToList(); + _declarations = Declarations.Except(decls).ToList(); } else { @@ -197,19 +203,33 @@ public void AddDeclaration(Declaration declaration) decl = UnionWrappers.FirstOrDefault(x => x.Name == declaration.Name); break; } - + break; + case Function function: + decl = Functions.FirstOrDefault(x => x.Name == declaration.Name); + break; + + case Delegate @delegate: + decl = Delegates.FirstOrDefault(x => x.Name == declaration.Name); + break; + + case GlobalUsings globalUsings: + decl = GlobalUsings.FirstOrDefault(x => x.Name == declaration.Name); + break; + + case DispatchTable dispatchTable: + decl = DispatchTables.FirstOrDefault(x => x.Name == declaration.Name); break; } if (decl == null) { - declarations.Add(declaration); + _declarations.Add(declaration); } } public void RemoveDeclaration(Declaration declaration) { - declarations.Remove(declaration); + _declarations.Remove(declaration); } public bool IsWrapperPresent(string declName, out Declaration declaration) diff --git a/QuantumBinding.Generator/AST/Delegate.cs b/QuantumBinding.Generator/AST/Delegate.cs index 5e6a61f..3744d6e 100755 --- a/QuantumBinding.Generator/AST/Delegate.cs +++ b/QuantumBinding.Generator/AST/Delegate.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using System.Runtime.InteropServices; using QuantumBinding.Generator.Types; @@ -26,6 +27,17 @@ public override string ToString() { return $"{AccessSpecifier} {ReturnType} {Name}"; } + + public void AddParameter(Parameter parameter) + { + var lastIndex = Parameters.Count == 0 ? 0: Parameters.Last().Index; + if (Parameters.Count > 0) + { + lastIndex++; + } + parameter.Index = lastIndex; + Parameters.Add(parameter); + } public override T Visit(IDeclarationVisitor visitor) { @@ -43,7 +55,7 @@ public override object Clone() Name = Name, Location = Location, Owner = Owner, - Comment = (Comment)Comment.Clone(), + Comment = (Comment)Comment?.Clone(), IsIgnored = IsIgnored, Id = Id, }; diff --git a/QuantumBinding.Generator/AST/DispatchTable.cs b/QuantumBinding.Generator/AST/DispatchTable.cs new file mode 100644 index 0000000..101496e --- /dev/null +++ b/QuantumBinding.Generator/AST/DispatchTable.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; + +namespace QuantumBinding.Generator.AST; + +public class DispatchTable : Declaration +{ + private readonly List _fields = new List(); + private readonly List _functionsToIgnore = new List(); + + public DispatchTable() + { + } + + public DispatchTable(DispatchTable copy) + { + _fields = new List(copy._fields); + TableOwner = copy.TableOwner; + Metadata = copy.Metadata; + } + + public Class TableOwner { get; set; } + + public string FunctionName { get; set; } + + public IReadOnlyList FunctionsToIgnore => _functionsToIgnore; + + public void AddField(Field field) + { + _fields.Add(field); + } + + public void IgnoreFunction(string functionName) + { + _functionsToIgnore.Add(functionName); + } + + public IReadOnlyList Fields => _fields; + + public Metadata Metadata { get; } = new Metadata(); + + public override T Visit(IDeclarationVisitor visitor) + { + return visitor.VisitDispatchTable(this); + } + + public override object Clone() + { + return new DispatchTable(this); + } +} \ No newline at end of file diff --git a/QuantumBinding.Generator/AST/Enumeration.cs b/QuantumBinding.Generator/AST/Enumeration.cs index 436e954..c6ac27f 100755 --- a/QuantumBinding.Generator/AST/Enumeration.cs +++ b/QuantumBinding.Generator/AST/Enumeration.cs @@ -40,7 +40,7 @@ public override object Clone() OriginalName = OriginalName, Owner = Owner, Location = Location, - Comment = (Comment)Comment.Clone() + Comment = (Comment)Comment?.Clone() }; } } \ No newline at end of file diff --git a/QuantumBinding.Generator/AST/Field.cs b/QuantumBinding.Generator/AST/Field.cs index 8327e33..800a50c 100755 --- a/QuantumBinding.Generator/AST/Field.cs +++ b/QuantumBinding.Generator/AST/Field.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using QuantumBinding.Generator.Types; namespace QuantumBinding.Generator.AST; @@ -32,10 +33,24 @@ public Field(string name) : this() public bool CanGenerateGetter { get; set; } = true; public bool CanGenerateSetter { get; set; } = true; + + public Func PredefinedInputSource { get; set; } + + public bool UsePredefinedInputSource { get; set; } = true; - public bool HasPredefinedValue => !string.IsNullOrEmpty(PredefinedValue); + public bool HasPredefinedValue => !string.IsNullOrEmpty(PredefinedValue) || PredefinedInputSource != null; public string PredefinedValue { get; set; } + + public string GetPredefinedValue() + { + if (UsePredefinedInputSource && PredefinedInputSource != null) + { + return PredefinedInputSource(); + } + + return PredefinedValue; + } public bool IsPredefinedValueReadOnly { get; set; } diff --git a/QuantumBinding.Generator/AST/Function.cs b/QuantumBinding.Generator/AST/Function.cs index c5bbd21..f566bf3 100755 --- a/QuantumBinding.Generator/AST/Function.cs +++ b/QuantumBinding.Generator/AST/Function.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Runtime.InteropServices; using QuantumBinding.Generator.Types; @@ -34,6 +35,17 @@ public override string ToString() return $"{AccessSpecifier} {ReturnType} {Name}"; } + public void AddParameter(Parameter parameter) + { + var lastIndex = Parameters.Count == 0 ? 0: Parameters.Last().Index; + if (Parameters.Count > 0) + { + lastIndex++; + } + parameter.Index = lastIndex; + Parameters.Add(parameter); + } + public override T Visit(IDeclarationVisitor visitor) { return visitor.VisitFunction(this); @@ -53,6 +65,7 @@ public override object Clone() Name = Name, OriginalName = OriginalName, Location = Location, + Comment = (Comment)Comment?.Clone(), Owner = Owner, IsIgnored = IsIgnored, Id = Id diff --git a/QuantumBinding.Generator/AST/GlobalUsingItem.cs b/QuantumBinding.Generator/AST/GlobalUsingItem.cs new file mode 100644 index 0000000..8cdcaef --- /dev/null +++ b/QuantumBinding.Generator/AST/GlobalUsingItem.cs @@ -0,0 +1,28 @@ +namespace QuantumBinding.Generator.AST; + +public class GlobalUsingItem : Declaration +{ + public Declaration Source { get; set; } + public Declaration Alias { get; set; } + + public GlobalUsingItem() + { + + } + + public GlobalUsingItem(GlobalUsingItem copy) + { + Source = copy.Source; + Alias = copy.Alias; + } + + public override T Visit(IDeclarationVisitor visitor) + { + return visitor.VisitGlobalUsingItem(this); + } + + public override object Clone() + { + return new GlobalUsingItem(this); + } +} \ No newline at end of file diff --git a/QuantumBinding.Generator/AST/GlobalUsings.cs b/QuantumBinding.Generator/AST/GlobalUsings.cs new file mode 100644 index 0000000..d6efca1 --- /dev/null +++ b/QuantumBinding.Generator/AST/GlobalUsings.cs @@ -0,0 +1,41 @@ +using System.Collections.Generic; + +namespace QuantumBinding.Generator.AST; + +public class GlobalUsings : Declaration +{ + private readonly List _usings = new List(); + + public GlobalUsings() + { + + } + + public GlobalUsings(GlobalUsings copy) + { + _usings.AddRange(copy._usings); + } + + public void AddUsing(Declaration alias, Declaration source) + { + if (source == null) + return; + + var item = new GlobalUsingItem(); + item.Source = source; + item.Alias = alias; + _usings.Add(item); + } + + public IReadOnlyList Usings => _usings; + + public override T Visit(IDeclarationVisitor visitor) + { + return visitor.VisitGlobalUsings(this); + } + + public override object Clone() + { + return new GlobalUsings(this); + } +} \ No newline at end of file diff --git a/QuantumBinding.Generator/AST/Macro.cs b/QuantumBinding.Generator/AST/Macro.cs index 20d5cc8..84a181b 100755 --- a/QuantumBinding.Generator/AST/Macro.cs +++ b/QuantumBinding.Generator/AST/Macro.cs @@ -22,6 +22,8 @@ public Macro() public BindingType Type { get; set; } public List Parameters { get; set; } + + public PrimitiveType PrimitiveType { get; set; } public override T Visit(IDeclarationVisitor visitor) { diff --git a/QuantumBinding.Generator/AST/Metadata.cs b/QuantumBinding.Generator/AST/Metadata.cs new file mode 100644 index 0000000..a7430a7 --- /dev/null +++ b/QuantumBinding.Generator/AST/Metadata.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; + +namespace QuantumBinding.Generator.AST; + +public class Metadata +{ + private readonly Dictionary _props = new(); + + public void Set(string key, T value) + { + _props[key] = value; + } + + public T Get(string key, T defaultValue = default) + { + if (_props.TryGetValue(key, out var props)) + { + return (T)props; + } + return defaultValue; + } +} \ No newline at end of file diff --git a/QuantumBinding.Generator/AST/Parameter.cs b/QuantumBinding.Generator/AST/Parameter.cs index 001a9b7..2d00e3e 100755 --- a/QuantumBinding.Generator/AST/Parameter.cs +++ b/QuantumBinding.Generator/AST/Parameter.cs @@ -25,6 +25,7 @@ public Parameter(Parameter parameter) Id = parameter.Id; Parent = Parent; IsOverload = parameter.IsOverload; + IsOptional = parameter.IsOptional; } public bool IsOverload { get; set; } @@ -42,6 +43,8 @@ public Parameter(Parameter parameter) public bool HasDefaultValue => !string.IsNullOrEmpty(DefaultValue); public string DefaultValue { get; set; } + + public bool IsOptional { get; set; } public override string ToString() { diff --git a/QuantumBinding.Generator/BindingsMapping/ArrayTypeMap.cs b/QuantumBinding.Generator/BindingsMapping/ArrayTypeMap.cs index 029d766..9b32f09 100755 --- a/QuantumBinding.Generator/BindingsMapping/ArrayTypeMap.cs +++ b/QuantumBinding.Generator/BindingsMapping/ArrayTypeMap.cs @@ -1,7 +1,4 @@ using QuantumBinding.Generator.Types; -using System; -using System.Collections.Generic; -using System.Text; using System.Xml.Serialization; namespace QuantumBinding.Generator.BindingsMapping; @@ -21,6 +18,9 @@ public class ArrayTypeMap : BindingTypeMap [XmlAttribute] public string ArraySizeSource { get; set; } + + [XmlAttribute] + public string MathExpression { get; set; } public override BindingType ToBindingType() { @@ -30,7 +30,8 @@ public override BindingType ToBindingType() SizeType = SizeType, Size = Size, ElementSize = ElementSize, - ArraySizeSource = ArraySizeSource + ArraySizeSource = ArraySizeSource, + MathExpression = MathExpression, }; } } \ No newline at end of file diff --git a/QuantumBinding.Generator/BindingsMapping/BindingTypeMap.cs b/QuantumBinding.Generator/BindingsMapping/BindingTypeMap.cs index d54b3a2..d3d4bc8 100755 --- a/QuantumBinding.Generator/BindingsMapping/BindingTypeMap.cs +++ b/QuantumBinding.Generator/BindingsMapping/BindingTypeMap.cs @@ -1,7 +1,4 @@ using QuantumBinding.Generator.Types; -using System; -using System.Collections.Generic; -using System.Text; using System.Xml.Serialization; namespace QuantumBinding.Generator.BindingsMapping; diff --git a/QuantumBinding.Generator/CSharpTypePrinter.cs b/QuantumBinding.Generator/CSharpTypePrinter.cs index e5e7fc6..ab7ca55 100755 --- a/QuantumBinding.Generator/CSharpTypePrinter.cs +++ b/QuantumBinding.Generator/CSharpTypePrinter.cs @@ -143,6 +143,10 @@ or MarshalTypes.SkipParamTypes return Result($"{visitResult}", "[]"); case MarshalTypes.MethodParameter: case MarshalTypes.SkipParamModifiers: + if (visitResult == "void") + { + visitResult = PrimitiveType.Nuint.GetDisplayName(); + } return Parameter.ParameterKind switch { ParameterKind.Out => Result($"{visitResult}", "[]"), @@ -151,6 +155,10 @@ or MarshalTypes.SkipParamTypes }; case MarshalTypes.Property: case MarshalTypes.WrappedProperty: + if (visitResult == "void") + { + visitResult = PrimitiveType.Nuint.GetDisplayName(); + } return Module.TargetRuntime == TargetRuntime.Net8Plus ? Result($"{visitResult}", "", wrapperType: ReadOnlyMemoryName) : Result($"{visitResult}", "[]"); @@ -165,7 +173,7 @@ public override TypePrinterResult VisitPointerType(PointerType pointer) TypePrinterResult result = null; var depth = pointerDepth; - if (pointerDepth > 0 && Parameter is { ParameterKind: ParameterKind.Out }) + if (pointerDepth > 1 && Parameter is { ParameterKind: ParameterKind.Out }) { depth--; } @@ -188,9 +196,9 @@ public override TypePrinterResult VisitPointerType(PointerType pointer) case not null when pointer.IsStringArray(out var isUnicode): result = Result(isUnicode ? "char" : "sbyte", DoublePointerOperator); break; - case not null when pointer.IsPointerToVoid() || pointer.IsPointerToObject(): + case not null when pointer.IsPointerToVoid(out _) || pointer.IsPointerToObject(): { - result = Result("nuint"); + result = Result("void", TextGenerator.GetPointerString(depth)); } break; case not null when pointer.IsPointerToIntPtr(): @@ -209,7 +217,7 @@ public override TypePrinterResult VisitPointerType(PointerType pointer) { pointer.Pointee.Declaration = pointer.Declaration; var printedType = pointer.Pointee.Visit(this); - + result = Result($"{printedType.Type}", TextGenerator.GetPointerString(depthCount)); } break; @@ -233,9 +241,10 @@ public override TypePrinterResult VisitPointerType(PointerType pointer) break; case not null when pointer.IsPointerToClass(out var @classDecl) && @classDecl.NativeStruct != null: - result = Parameter is { ParameterKind: ParameterKind.Out } - ? Result(@classDecl.NativeStruct.Name) - : Result(@classDecl.NativeStruct.Name, TextGenerator.GetPointerString(depth)); + // result = Parameter is { ParameterKind: ParameterKind.Out } + // ? Result(@classDecl.NativeStruct.Name) + // : Result(@classDecl.NativeStruct.Name, TextGenerator.GetPointerString(depth)); + result = Result(@classDecl.NativeStruct.Name, TextGenerator.GetPointerString(depth)); break; default: result = pointer.Pointee.Visit(this); @@ -278,7 +287,7 @@ public override TypePrinterResult VisitPointerType(PointerType pointer) case not null when pointer.IsPointerToObject(): result = Result("object"); break; - case not null when pointer.IsPointerToVoid(): + case not null when pointer.IsPointerToVoid(out _): result = Result("nuint"); break; case not null when pointer.IsPointerToIntPtr(): @@ -366,6 +375,8 @@ or MarshalTypes.DelegateType return "byte"; case PrimitiveType.Byte: return "byte"; + case PrimitiveType.Sbyte: + return "sbyte"; case PrimitiveType.SChar: if (Module.CharAsBoolForMethods && MarshalType is MarshalTypes.NativeParameter @@ -405,6 +416,8 @@ or MarshalTypes.DelegateType return "void"; case PrimitiveType.String: return "string"; + case PrimitiveType.Nuint: + return builtin.Type.GetDisplayName(); default: return "Unknown"; } @@ -502,6 +515,19 @@ public override TypePrinterResult VisitDependentNameType(DependentNameType depen return dependentNameType.Identifier; } + public override TypePrinterResult VisitDispatchTableType(DispatchTableType dispatchTableType) + { + return dispatchTableType.Declaration.FullName; + } + + public override TypePrinterResult VisitDispatchTable(DispatchTable dispatchTable) + { + var sb = new StringBuilder(); + sb.Append($"{dispatchTable.Name}"); + + return sb.ToString(); + } + public override TypePrinterResult VisitParameters(IEnumerable @params, MarshalTypes marshalType, bool isExtensionMethod = false) { @@ -578,12 +604,12 @@ public override TypePrinterResult VisitParameter(Parameter parameter) } } - if (parameter.ParameterKind == ParameterKind.Out && - !parameter.Type.IsPointerToArray() && - !parameter.Type.IsDoublePointer()) - { - result.TypeSuffix = string.Empty; - } + // if (parameter.ParameterKind == ParameterKind.Out && + // !parameter.Type.IsPointerToArray(out var arrayType, out var depthCount) && + // !parameter.Type.IsPurePointer()) + // { + // result.TypeSuffix = string.Empty; + // } if (MarshalType == MarshalTypes.DelegateType) { @@ -650,9 +676,24 @@ public override TypePrinterResult VisitEnumItem(EnumerationItem item) return $"{item.Name} = {item.Value}"; } + public override TypePrinterResult VisitGlobalUsings(GlobalUsings globalUsings) + { + var sb = new StringBuilder(); + foreach (var usingItem in globalUsings.Usings) + { + sb.AppendLine(usingItem.Visit(this).ToString()); + } + return sb.ToString(); + } + + public override TypePrinterResult VisitGlobalUsingItem(GlobalUsingItem item) + { + return $"global using {item.Alias.FullName} = {item.Source.FullName}"; + } + public override TypePrinterResult VisitClass(Class @class) { - StringBuilder builder = new StringBuilder(); + var builder = new StringBuilder(); builder.Append($"{GetAccessSpecifier(@class.AccessSpecifier)} unsafe "); builder.Append("partial "); @@ -678,7 +719,7 @@ public override TypePrinterResult VisitField(Field field) if (field.Type == null) { string result = string.Empty; - if (MarshalType != MarshalTypes.MethodParameter) + if (MarshalType != MarshalTypes.MethodParameter && MarshalType != MarshalTypes.SkipParamTypesAndModifiers) { result = $"{GetAccessSpecifier(field.AccessSpecifier)} "; } @@ -686,7 +727,7 @@ public override TypePrinterResult VisitField(Field field) return result += field.Name; } - StringBuilder builder = new StringBuilder(); + var builder = new StringBuilder(); PushField(field); var fieldResult = field.Type.Visit(this); if (field.Type.IsPointerToStructOrUnion()) @@ -694,11 +735,16 @@ public override TypePrinterResult VisitField(Field field) fieldResult = $"{field.Type.Declaration.InteropNamespace}.{fieldResult}"; } PopField(); - if (MarshalType != MarshalTypes.MethodParameter) + if (MarshalType != MarshalTypes.MethodParameter && MarshalType != MarshalTypes.SkipParamTypesAndModifiers) { builder.Append($"{GetAccessSpecifier(field.AccessSpecifier)} "); } + if (MarshalType == MarshalTypes.SkipParamTypesAndModifiers) + { + return fieldResult; + } + builder.Append($"{fieldResult} "); builder.Append($"{field.Name}"); if (!string.IsNullOrEmpty(fieldResult.ParameterSuffix)) @@ -775,13 +821,13 @@ private bool ContainsModifiers(Parameter param, out string attribute, out string if (MarshalType is MarshalTypes.SkipParamTypes or MarshalTypes.DelegateType or MarshalTypes.DelegateParameter) { - if (param.ParameterKind == ParameterKind.Ref && !(param.Type.IsPurePointer())) - { - modifier = "ref"; - return true; - } + // if (param.ParameterKind == ParameterKind.Ref && !(param.Type.IsPurePointer())) + // { + // modifier = "ref"; + // return true; + // } - if (param.ParameterKind == ParameterKind.Out) + if (param.ParameterKind == ParameterKind.Out && (param.Type.IsPointerToVoid(out var depth) && depth > 1)) { modifier = "out"; return true; @@ -815,19 +861,11 @@ private bool ContainsModifiers(Parameter param, out string attribute, out string { switch (param.ParameterKind) { - case ParameterKind.Ref: - if (param.Type.IsPointerToIntPtr()) - { - attribute = "[In, Out]"; - } - - break; case ParameterKind.Out: - if (!param.Type.IsPointerToArray()) + if (param.Type.IsPointerToVoid(out var depth) && depth > 1) { modifier = "out"; } - break; } } diff --git a/QuantumBinding.Generator/CodeGeneration/CSharpCodeGenerator.cs b/QuantumBinding.Generator/CodeGeneration/CSharpCodeGenerator.cs index 04ddd5e..f3a814f 100755 --- a/QuantumBinding.Generator/CodeGeneration/CSharpCodeGenerator.cs +++ b/QuantumBinding.Generator/CodeGeneration/CSharpCodeGenerator.cs @@ -78,7 +78,14 @@ public override void Run(Declaration declaration) protected virtual void GenerateTranslationUnit(TranslationUnit unit) { CurrentTranslationUnit = unit; - GenerateNamespace(unit); + if (Category == GeneratorCategory.GlobalUsings) + { + GenerateGlobalUsings(unit); + } + else + { + GenerateNamespace(unit); + } } protected virtual void GenerateTranslationUnitForDeclaration(TranslationUnit unit, Declaration declaration) @@ -112,6 +119,32 @@ protected virtual void GenerateNamespace(Namespace @namespace, Declaration decla } } + protected virtual void GenerateGlobalUsings(TranslationUnit unit) + { + if (unit.GlobalUsings.Count == 0) + { + IsEmpty = true; + return; + } + + PushBlock(CodeBlockKind.Usings); + foreach (var @using in unit.GlobalUsings) + { + GenerateGlobalUsingScope(@using); + NewLine(); + } + PopBlock(NewLineStrategy.NewLineBeforeNextBlock); + } + + protected virtual void GenerateGlobalUsingScope(GlobalUsings globalUsings) + { + foreach (var @using in globalUsings.Usings) + { + WriteLine($"global using {@using.Alias.FullName} = {@using.Source.FullName};"); + } + NewLine(); + } + protected virtual bool IsDeclarationEqualsSpec(Declaration decl, GeneratorSpecializations spec) { switch (spec) @@ -283,7 +316,15 @@ protected override void GenerateMacro(Macro macro) WriteLocation(macro); if (!macro.IsFunctionLike) { - WriteLine($"public static {macro.Type.Visit(TypePrinter)} {macro.Name} => {macro.Value};"); + switch (macro.PrimitiveType) + { + case PrimitiveType.String: + WriteLine($"public static {macro.Type.Visit(TypePrinter)} {macro.Name} => \"{macro.Value}\";"); + break; + default: + WriteLine($"public static {macro.Type.Visit(TypePrinter)} {macro.Name} => {macro.Value};"); + break; + } } else { @@ -626,7 +667,7 @@ protected override void GenerateFunction(Function function) PushBlock(CodeBlockKind.AccessSpecifier); Write($"{TypePrinter.GetAccessSpecifier(function.AccessSpecifier)} static extern"); PopBlock(NewLineStrategy.SpaceBeforeNextBlock); - + var returnType = function.ReturnType.Visit(TypePrinter); Write($"{returnType} {function.Name}("); CheckParameters(function.Parameters); diff --git a/QuantumBinding.Generator/CodeGeneration/CSharpCodeGeneratorBase.cs b/QuantumBinding.Generator/CodeGeneration/CSharpCodeGeneratorBase.cs index 4ca453f..7ba2fcc 100755 --- a/QuantumBinding.Generator/CodeGeneration/CSharpCodeGeneratorBase.cs +++ b/QuantumBinding.Generator/CodeGeneration/CSharpCodeGeneratorBase.cs @@ -283,10 +283,15 @@ protected virtual void GenerateConstructor(Constructor ctor) Write(")"); NewLine(); WriteOpenBraceAndIndent(); + var @class = ctor.Class; foreach (var param in ctor.InputParameters) { WriteLine($"this.{param.Name} = {param.Name};"); } + if (@class.ClassType == ClassType.Class && @class.IsDispatchTableOwner) + { + WriteLine($"this.{@class.DispatchFieldName} = new {@class.DispatchTable.Name}(this);"); + } UnindentAndWriteCloseBrace(); } diff --git a/QuantumBinding.Generator/CodeGeneration/CodeBlockKind.cs b/QuantumBinding.Generator/CodeGeneration/CodeBlockKind.cs index f2ccb0f..4623715 100755 --- a/QuantumBinding.Generator/CodeGeneration/CodeBlockKind.cs +++ b/QuantumBinding.Generator/CodeGeneration/CodeBlockKind.cs @@ -29,5 +29,6 @@ public enum CodeBlockKind Delegate, Macro, DebugInfo, - Utils + Utils, + DispatchTable } \ No newline at end of file diff --git a/QuantumBinding.Generator/CodeGeneration/CsFilesFileGenerator.cs b/QuantumBinding.Generator/CodeGeneration/CsFilesFileGenerator.cs index 0cf053e..308d0b7 100644 --- a/QuantumBinding.Generator/CodeGeneration/CsFilesFileGenerator.cs +++ b/QuantumBinding.Generator/CodeGeneration/CsFilesFileGenerator.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using QuantumBinding.Generator.AST; using QuantumBinding.Generator.Utils; diff --git a/QuantumBinding.Generator/CodeGeneration/GeneratorCategory.cs b/QuantumBinding.Generator/CodeGeneration/GeneratorCategory.cs index 188cb3f..6048145 100644 --- a/QuantumBinding.Generator/CodeGeneration/GeneratorCategory.cs +++ b/QuantumBinding.Generator/CodeGeneration/GeneratorCategory.cs @@ -15,5 +15,7 @@ public enum GeneratorCategory UnionWrappers = 512, StaticMethods = 1024, ExtensionMethods = 2048, - Extensions = 4096 + Extensions = 4096, + GlobalUsings = 8192, + DispatchTables = 16384, } \ No newline at end of file diff --git a/QuantumBinding.Generator/CodeGeneration/GeneratorSpecializations.cs b/QuantumBinding.Generator/CodeGeneration/GeneratorSpecializations.cs index 41adb6b..5fa18b6 100755 --- a/QuantumBinding.Generator/CodeGeneration/GeneratorSpecializations.cs +++ b/QuantumBinding.Generator/CodeGeneration/GeneratorSpecializations.cs @@ -19,5 +19,7 @@ public enum GeneratorSpecializations StaticMethods = 1024, ExtensionMethods = 2048, Extensions = 4096, - All = Macros|Enums|Structs|Unions|Classes|Delegates|OldFashionDelegates|Functions|StructWrappers|UnionWrappers|StaticMethods|ExtensionMethods|Extensions + GlobalUsings = 8192, + DispatchTables = 16384, + All = Macros|Enums|Structs|Unions|Classes|Delegates|OldFashionDelegates|Functions|StructWrappers|UnionWrappers|StaticMethods|ExtensionMethods|Extensions|GlobalUsings|DispatchTables } \ No newline at end of file diff --git a/QuantumBinding.Generator/CodeGeneration/MarshalContextToFunctionCodeGenerator.cs b/QuantumBinding.Generator/CodeGeneration/MarshalContextToFunctionCodeGenerator.cs index 246fcea..6c9e1ec 100644 --- a/QuantumBinding.Generator/CodeGeneration/MarshalContextToFunctionCodeGenerator.cs +++ b/QuantumBinding.Generator/CodeGeneration/MarshalContextToFunctionCodeGenerator.cs @@ -114,6 +114,9 @@ public virtual TypePrinterResult GenerateMarshalBody(Method method) Write("var result = "); PostActions.Enqueue(ConvertReturnType); break; + case false when method.ReturnType.IsPointerToVoid(out var depth): + Write("var result = "); + break; case false when PostActions.Count == 0: Write("return "); break; @@ -124,9 +127,18 @@ public virtual TypePrinterResult GenerateMarshalBody(Method method) var @namespace = method.Function.Namespace; - var functionCall = - $"{@namespace}.{CurrentTranslationUnit.Module.InteropClassName}.{method.Function.Name}({TypePrinter.VisitParameters(NativeParameters, MarshalTypes.NativeFunctionCall)});"; - Write(functionCall); + if (method.IsInstanceMethod && method.Class.IsDispatchable && method.Class.DispatchTable != null && !method.Class.DispatchTable.FunctionsToIgnore.Contains(method.Function.Name)) + { + var parametersSting = TypePrinter.VisitParameters(NativeParameters, MarshalTypes.NativeFunctionCall); + Write($"{method.Class.DispatchFieldName}.{method.Function.Name}({parametersSting});"); + } + else + { + var functionCall = + $"{@namespace}.{CurrentTranslationUnit.Module.InteropClassName}.{method.Function.Name}({TypePrinter.VisitParameters(NativeParameters, MarshalTypes.NativeFunctionCall)});"; + Write(functionCall); + } + NewLine(); var hasPostActions = PostActions.Count > 0; @@ -147,6 +159,10 @@ public virtual TypePrinterResult GenerateMarshalBody(Method method) WriteLine("return result;"); } } + else if (method.ReturnType.IsPointerToVoid(out var depth)) + { + WriteLine($"return ({PrimitiveType.Nuint.GetDisplayName()})result;"); + } else if (method.ReturnType.IsString()) { WriteLine($"return new string(result);"); @@ -202,26 +218,12 @@ protected void MarshalSimpleType(Parameter parameter, string argumentName) else if (parameter.Type.IsPointerToBuiltInType(out var prim) && !parameter.Type.IsPurePointer()) { WritePointerToPrimitiveType(parameter, argumentName); - var nativeParam = new Parameter() - { - ParameterKind = parameter.ParameterKind, Type = parameter.Type - }; - switch (parameter.ParameterKind) - { - case ParameterKind.Out: - nativeParam.Name = parameter.Name; - break; - default: - nativeParam.Name = argumentName; - break; - } - - NativeParameters.Add(nativeParam); + CreateNativeParameter(parameter, argumentName, null); } // The input parameter is void*, so we need to just pass it as is without any conversion - else if (parameter.Type.IsPointerToIntPtr() || parameter.Type.IsPurePointer()) + else if (parameter.Type.IsPurePointer()) { - NativeParameters.Add(parameter); + WritePointerToVoid(parameter, argumentName); } else if (parameter.Type.Declaration == null || !parameter.Type.IsPointer()) { @@ -229,6 +231,35 @@ protected void MarshalSimpleType(Parameter parameter, string argumentName) } } + private void WritePointerToVoid(Parameter parameter, string argumentName) + { + var pointerType = parameter.Type as PointerType; + var depth = pointerType.GetDepth(); + + if (parameter.ParameterKind is ParameterKind.Out or ParameterKind.Ref) + { + if (parameter.ParameterKind == ParameterKind.Out) + { + WriteLine($"void{GetPointerString(depth)} {argumentName} = null;"); + } + else + { + WriteLine($"void{GetPointerString(depth)} {argumentName} = (void{GetPointerString(depth)}){parameter.Name};"); + } + + CreateNativeParameter(parameter, argumentName, parameter.Type.Declaration); + PostActions.Enqueue(() => + { + WriteLine($"{parameter.Name} = (nuint){argumentName};"); + }); + } + else + { + WriteLine($"void{GetPointerString(depth)} {argumentName} = (void{GetPointerString(depth)}){parameter.Name};"); + CreateNativeParameter(parameter, argumentName, parameter.Type.Declaration); + } + } + protected virtual void MarshalComplexType(Parameter parameter, Declaration declaration, string argumentName) { if (declaration is Class classDecl) @@ -426,8 +457,10 @@ public void MarshalClass(Parameter parameter, string argumentName, Class classDe var argumentType = parameter.Type.Visit(TypePrinter); TypePrinter.PopParameter(); TypePrinter.PopMarshalType(); - WriteLine($"{argumentType} {argumentName};"); - PostActions.Enqueue(() => ConvertOutStructToClass(parameter, argumentName, classDecl)); + WriteLine($"{argumentType.Type} {argumentName} = {Default};"); + var argName = argumentName; + PostActions.Enqueue(() => ConvertOutStructToClass(parameter, argName, classDecl)); + argumentName = $"&{argumentName}"; } CreateNativeParameter(parameter, argumentName, classDecl); @@ -493,6 +526,11 @@ void MarshalPointerToManagedArray() else { WriteLine($"{parameter.Name}[i] = {argumentName}[i];"); + + if (classDecl.ClassType == ClassType.Class && classDecl.IsDispatchable && !classDecl.IsDispatchTableOwner) + { + WriteLine($"{parameter.Name}[i].{classDecl.DispatchFieldName} = this.{classDecl.DispatchFieldName};"); + } } UnindentAndWriteCloseBrace(); } @@ -577,14 +615,17 @@ protected void MarshalPointerToStruct(Parameter parameter, string argumentName, { PostActions.Enqueue(() => ConvertPointerToClassOrStruct(parameter, argumentName, classDecl)); } + CreateNativeParameter(parameter, argumentName, classDecl); } else if (parameter.ParameterKind == ParameterKind.Out) { - WriteLine($"{interopType} {argumentName};"); + var ptrType = parameter.Type as PointerType; + var ptrDepth = ptrType.GetDepth(); + ptrDepth--; + WriteLine($"{nativeType}{GetPointerString(ptrDepth)} {argumentName} = {Default};"); PostActions.Enqueue(() => ConvertOutStructToClass(parameter, argumentName, classDecl)); + CreateNativeParameter(parameter, $"&{argumentName}", classDecl); } - - CreateNativeParameter(parameter, argumentName, classDecl); } protected void WritePointerToSimpleType(Parameter parameter, string argumentName, Class classDecl) @@ -618,8 +659,10 @@ protected void WritePointerToSimpleType(Parameter parameter, string argumentName } else if (classDecl.IsSimpleType) { - WriteLine($"{nativeType} {argumentName};"); - PostActions.Enqueue(() => ConvertOutStructToClass(parameter, argumentName, classDecl)); + WriteLine($"{nativeType.Type} {argumentName} = {Default};"); + var argName = argumentName; + PostActions.Enqueue(() => ConvertOutStructToClass(parameter, argName, classDecl)); + argumentName = $"&{argumentName}"; } else { @@ -654,7 +697,7 @@ protected void WritePointerToArray(Parameter parameter, string argumentName, Cla if (classDecl.ClassType == ClassType.Class) { WriteLine($"{classDecl.NativeStruct.Namespace}.{typeStrResult} {argumentName} = null;"); - WriteLine($"{SpanClassName}<{classDecl.NativeStruct.FullName}> {argumentName}Span = default;"); + WriteLine($"{SpanClassName}<{classDecl.NativeStruct.FullName}> {argumentName}Span = {Default};"); ImplicitTwoWayArrayTypeConversion(parameter, classDecl, argumentName, arrayLength); } else @@ -778,6 +821,10 @@ void ConvertPointerToArray(Parameter parameter, string argumentName, Class class WriteLine(classType == ClassType.Class ? $"{parameter.Name}[i] = {argumentName}[i];" : $"{parameter.Name}[i] = new {type}({argumentName}[i]);"); + if (classType == ClassType.Class && classDecl.IsDispatchable && !classDecl.IsDispatchTableOwner) + { + WriteLine($"{parameter.Name}[i].{classDecl.DispatchFieldName} = this.{classDecl.DispatchFieldName};"); + } } UnindentAndWriteCloseBrace(); @@ -833,7 +880,7 @@ private void WriteDefaultOutParameterInitialization(Parameter parameter) { WriteLine("else"); PushIndent(); - WriteLine($"{parameter.Name} = default;"); + WriteLine($"{parameter.Name} = {Default};"); PopIndent(); } } @@ -850,14 +897,27 @@ protected void WritePointerToArrayForBuiltInType(Parameter parameter, string arg TypePrinter.PushMarshalType(MarshalTypes.NativeParameter); TypePrinter.PushParameter(parameter); var typeStrResult = parameter.Type.Visit(TypePrinter); + var originalTypeStr = typeStrResult; + if (typeStrResult.Type == "void") + { + typeStrResult = PrimitiveType.Nuint.GetDisplayName(); + } TypePrinter.PopParameter(); TypePrinter.PopMarshalType(); if (parameter.ParameterKind is ParameterKind.In or ParameterKind.Readonly) { - WriteLine( - $"var {argumentName} = {MarshalContextUtilsBlittableArray}<{typeStrResult.Type}>({parameter.Name}, ref {_spanBufferCursorName});"); - + if (pointerDepth == 1) + { + WriteLine( + $"var {argumentName} = {MarshalContextUtilsBlittableArray}<{typeStrResult.Type}>({parameter.Name}, ref {_spanBufferCursorName});"); + } + else + { + WriteLine( + $"var {argumentName} = ({originalTypeStr}){MarshalContextUtilsBlittableArray}<{typeStrResult.Type}>({parameter.Name}, ref {_spanBufferCursorName});"); + } + } else if (parameter.ParameterKind == ParameterKind.Ref) { @@ -881,20 +941,55 @@ protected void ConvertPointerToArrayOfNativeType(Parameter parameter, string arg WriteLine($"{parameter.Name} = new {typeStrResult}[{arrayLength}];"); } - WriteLine($"{parameter.Name} = {MarshalContextUtilsUnmarshalBlittableArray}({argumentName}, {arrayLength});"); + WriteLine($"{parameter.Name} = {MarshalContextUtilsUnmarshalBlittableArray}({argumentName}, (long){arrayLength});"); } protected void WritePointerToPrimitiveType(Parameter parameter, string argumentName) { - if (parameter.ParameterKind is not ParameterKind.Out) + TypePrinter.PushMarshalType(MarshalTypes.NativeParameter); + TypePrinter.PushParameter(parameter); + var interopType = parameter.Type.Visit(TypePrinter); + TypePrinter.PopParameter(); + TypePrinter.PopMarshalType(); + WriteLine($"var {argumentName} = {StackAlloc} {interopType.Type}[1];"); + if (parameter.ParameterKind != ParameterKind.Out) + { + WriteLine($"*{argumentName} = {parameter.Name};"); + } + + if (parameter.ParameterKind is ParameterKind.Ref or ParameterKind.Out) + { + PostActions.Enqueue(() => ConvertOutPrimitiveTypePointerToValue(parameter, argumentName)); + } + } + + protected void WritePointerToArrayOfPrimitiveTypes(Parameter parameter, ArrayType arrayType, string argumentName) + { + if (parameter.ParameterKind is ParameterKind.Out) { TypePrinter.PushMarshalType(MarshalTypes.NativeParameter); TypePrinter.PushParameter(parameter); var interopType = parameter.Type.Visit(TypePrinter); TypePrinter.PopParameter(); TypePrinter.PopMarshalType(); - WriteLine($"var {argumentName} = {StackAlloc} {interopType.Type}[1];"); - WriteLine($"*{argumentName} = {parameter.Name};"); + var arrayLength = arrayType.Size.ToString(); + if (arrayType.ArraySizeSource != null) + { + arrayLength = arrayType.ArraySizeSource; + } + + WriteLine($"{interopType} {argumentName} = null;"); + WriteLine($"if ({arrayLength} < {StackAllocThresholdPropertyName})"); + WriteOpenBraceAndIndent(); + WriteLine($"{interopType} {argumentName}1 = {StackAlloc} {interopType.Type}[(int){arrayLength}];"); + WriteLine($"{argumentName} = {argumentName}1;"); + UnindentAndWriteCloseBrace(); + WriteLine($"else"); + WriteOpenBraceAndIndent(); + WriteLine($"{argumentName} = ({interopType})NativeMemory.Alloc((nuint){arrayLength});"); + UnindentAndWriteCloseBrace(); + + PostActions.Enqueue(() => ConvertOutPointerToArrayOfPrimitiveTypes(parameter, argumentName, arrayType)); } if (parameter.ParameterKind is ParameterKind.Ref) @@ -902,6 +997,35 @@ protected void WritePointerToPrimitiveType(Parameter parameter, string argumentN PostActions.Enqueue(() => ConvertOutPrimitiveTypePointerToValue(parameter, argumentName)); } } + + void ConvertOutPointerToArrayOfPrimitiveTypes(Parameter parameter, string argumentName, ArrayType arrayType) + { + TypePrinter.PushMarshalType(MarshalTypes.MethodParameter); + TypePrinter.PushParameter(parameter); + var parameterType = parameter.Type.Visit(TypePrinter); + TypePrinter.PopParameter(); + TypePrinter.PopMarshalType(); + + TypePrinter.PushMarshalType(MarshalTypes.NativeParameter); + TypePrinter.PushParameter(parameter); + var interopType = parameter.Type.Visit(TypePrinter); + TypePrinter.PopParameter(); + TypePrinter.PopMarshalType(); + + var arrayLength = arrayType.Size.ToString(); + if (arrayType.ArraySizeSource != null) + { + arrayLength = arrayType.ArraySizeSource; + } + + WriteLine($"{parameter.Name} = new {parameterType.Type}[{arrayLength}];"); + WriteLine($"{UnsafeClassName}.CopyBlock(ref {parameter.Name}[0], ref {argumentName}[0], (uint){arrayLength});"); + + WriteLine($"if ({arrayLength} > {StackAllocThresholdPropertyName})"); + PushIndent(); + FreeNativePointer(argumentName); + PopIndent(); + } void ConvertOutPrimitiveTypePointerToValue(Parameter parameter, string argumentName) { @@ -930,12 +1054,23 @@ protected void ConvertOutStructToClass(Parameter parameter, string argumentName, UnindentAndWriteCloseBrace(); WriteLine($"else"); WriteOpenBraceAndIndent(); - WriteLine($"{parameter.Name} = (default);"); + WriteLine($"{parameter.Name} = {Default};"); UnindentAndWriteCloseBrace(); } else { - WriteLine($"{parameter.Name} = new {wrapperType}({argumentName});"); + if (classDecl.ClassType == ClassType.Class || classDecl.IsWrapper) + { + WriteLine($"{parameter.Name} = new {wrapperType}({argumentName});"); + if (classDecl.ClassType == ClassType.Class && classDecl.IsDispatchable && !classDecl.IsDispatchTableOwner) + { + WriteLine($"{parameter.Name}.{classDecl.DispatchFieldName} = this.{classDecl.DispatchFieldName};"); + } + } + else if (classDecl.IsSimpleType) + { + WriteLine($"{parameter.Name} = {argumentName};"); + } } } @@ -988,18 +1123,14 @@ protected void WriteEnumeration(Parameter parameter, string argumentName, Enumer } else { - if (parameter.ParameterKind is not ParameterKind.Out) + WriteLine($"var {argumentName} = {StackAlloc} {enumeration.FullName}[1];"); + if (parameter.ParameterKind != ParameterKind.Out) { - WriteLine($"var {argumentName} = {StackAlloc} {enumeration.FullName}[1];"); WriteLine($"*{argumentName} = {parameter.Name};"); } - else - { - argumentName = parameter.Name; - } } - if (parameter.ParameterKind is ParameterKind.Ref) + if (parameter.ParameterKind is ParameterKind.Ref or ParameterKind.Out) { PostActions.Enqueue(() => ConvertPointerToEnum(parameter, argumentName)); } @@ -1030,7 +1161,10 @@ void ConvertPointerToArrayOfEnums(Parameter parameter, string argumentName, Enum WriteLine($"var {argumentName}SourceSpan = new {ReadonlySpanClassName}<{enumeration.FullName}>({argumentName}, (int){arrayLength});"); if (parameter.ParameterKind is ParameterKind.Ref) { + WriteLine($"if(!{parameter.Name}.IsEmpty)"); + PushIndent(); WriteLine($"{argumentName}SourceSpan.CopyTo({parameter.Name});"); + PopIndent(); } else { @@ -1061,18 +1195,20 @@ private void ConvertReturnType() TypePrinter.PushMarshalType(MarshalTypes.MethodParameter); var wrappedType = Method.ReturnType.Visit(TypePrinter); TypePrinter.PopMarshalType(); - var classDecl = Method.ReturnType.Declaration as Class; - if (classDecl is { IsWrapper: true }) - { - WriteLine($"var wrappedResult = new {wrappedType.Type}(*result);"); - FreeNativePointer("result"); - WriteLine("return wrappedResult;"); - } - else if (classDecl.ClassType == ClassType.Class) + if (Method.ReturnType.Declaration is Class classDecl) { - WriteLine($"var classResult = *result;"); - FreeNativePointer("result"); - WriteLine("return classResult;"); + if (classDecl is { IsWrapper: true }) + { + WriteLine($"var wrappedResult = new {wrappedType.Type}(*result);"); + FreeNativePointer("result"); + WriteLine("return wrappedResult;"); + } + else if (classDecl.ClassType == ClassType.Class) + { + WriteLine($"var classResult = *result;"); + FreeNativePointer("result"); + WriteLine("return classResult;"); + } } } diff --git a/QuantumBinding.Generator/CodeGeneration/MethodToFunctionCodeGenerator.cs b/QuantumBinding.Generator/CodeGeneration/MethodToFunctionCodeGenerator.cs index c8b69df..d4ce7a0 100644 --- a/QuantumBinding.Generator/CodeGeneration/MethodToFunctionCodeGenerator.cs +++ b/QuantumBinding.Generator/CodeGeneration/MethodToFunctionCodeGenerator.cs @@ -131,30 +131,44 @@ protected override void ProcessParameter(Parameter parameter, string argumentNam }); } } + else if (parameter.Type.IsPointerToArray(out var arrayType, out var depth)) + { + WritePointerToArrayOfPrimitiveTypes(parameter, arrayType, argumentName); + + CreateNativeParameter(parameter, argumentName, null); + } else if (parameter.Type.IsPointerToBuiltInType(out var prim) && !parameter.Type.IsPurePointer()) { WritePointerToPrimitiveType(parameter, argumentName); - - var nativeParam = new Parameter() - { - ParameterKind = parameter.ParameterKind, Type = parameter.Type - }; - switch (parameter.ParameterKind) - { - case ParameterKind.Out: - nativeParam.Name = parameter.Name; - break; - default: - nativeParam.Name = argumentName; - break; - } - - NativeParameters.Add(nativeParam); + + CreateNativeParameter(parameter, argumentName, null); } // The input parameter is void*, so we need to just pass it as is without any conversion else if (parameter.Type.IsPointerToIntPtr() || parameter.Type.IsPurePointer()) { - NativeParameters.Add(parameter); + TypePrinter.PushParameter(parameter); + TypePrinter.PushMarshalType(MarshalTypes.NativeParameter); + var pointerType = parameter.Type.Visit(TypePrinter); + TypePrinter.PopMarshalType(); + TypePrinter.PopParameter(); + if (parameter.ParameterKind == ParameterKind.Out) + { + WriteLine($"{pointerType} {argumentName} = null;"); + } + else + { + WriteLine($"var {argumentName} = ({pointerType}){parameter.Name};"); + } + + if (parameter.ParameterKind is ParameterKind.Out or ParameterKind.Ref) + { + PostActions.Enqueue(() => + { + WriteLine($"{parameter.Name} = ({PrimitiveType.Nuint.GetDisplayName()}){argumentName};"); + }); + } + + CreateNativeParameter(parameter, argumentName, null); } else if (parameter.Type.Declaration == null || !parameter.Type.IsPointer()) { diff --git a/QuantumBinding.Generator/CodeGeneration/MethodToRefStructCodeGenerator.cs b/QuantumBinding.Generator/CodeGeneration/MethodToRefStructCodeGenerator.cs index 3bb4dd9..99f3f53 100644 --- a/QuantumBinding.Generator/CodeGeneration/MethodToRefStructCodeGenerator.cs +++ b/QuantumBinding.Generator/CodeGeneration/MethodToRefStructCodeGenerator.cs @@ -117,7 +117,7 @@ void GenerateCalculateSizeMethod(Method method) } else if (parameter.Type.IsPointerToArrayOfPrimitiveTypes(out var elementType)) { - WriteLine($"{totalSizeName} += {parameter.Name}.Length * sizeof({elementType.Type});"); + WriteLine($"{totalSizeName} += {parameter.Name}.Length * sizeof({elementType.Type.GetDisplayName()});"); } else if (parameter.Type.IsPointerToArrayOfEnums()) { @@ -143,6 +143,14 @@ void GenerateCalculateSizeMethod(Method method) } }); } + else if (parameter.Type.IsPointerToArray(out var arrayType, out var depth)) + { + WriteLine($"{totalSizeName} += {parameter.Name}.Length * sizeof({PrimitiveType.Nuint.GetDisplayName()});"); + } + else if (parameter.Type.IsDoublePointer()) + { + WriteLine($"{totalSizeName} += sizeof({PrimitiveType.Nuint.GetDisplayName()});"); + } else if (parameter.Type.IsWrapper()) { WriteLine($"if ({parameter.Name} != null)"); @@ -208,9 +216,9 @@ private void WriteTryFinallyBlock(Action action) WriteOpenBraceAndIndent(); action?.Invoke(); UnindentAndWriteCloseBrace(); - WriteLine($"finally"); + WriteLine("finally"); WriteOpenBraceAndIndent(); - WriteLine($"if (rentedArray != null)"); + WriteLine("if (rentedArray != null)"); PushIndent(); WriteLine($"System.Buffers.ArrayPool.Shared.Return(rentedArray);"); PopIndent(); diff --git a/QuantumBinding.Generator/CodeGeneration/TextGenerator.cs b/QuantumBinding.Generator/CodeGeneration/TextGenerator.cs index 09e424a..c7842ed 100755 --- a/QuantumBinding.Generator/CodeGeneration/TextGenerator.cs +++ b/QuantumBinding.Generator/CodeGeneration/TextGenerator.cs @@ -8,6 +8,7 @@ namespace QuantumBinding.Generator.CodeGeneration; public class TextGenerator: ITextGenerator { public static string NullPointer => "null"; + public static string Default => "default"; public static string StackAlloc => "stackalloc"; diff --git a/QuantumBinding.Generator/CodeGeneration/WrapperGenerator.cs b/QuantumBinding.Generator/CodeGeneration/WrapperGenerator.cs index 3628bcb..d365cff 100755 --- a/QuantumBinding.Generator/CodeGeneration/WrapperGenerator.cs +++ b/QuantumBinding.Generator/CodeGeneration/WrapperGenerator.cs @@ -196,14 +196,14 @@ private void GenerateIMarshallableInterface(Class @class) private void GenerateIMarshallableObjectInterface(Class @class) { - WriteLine($"public nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct"); + WriteLine($"public void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct"); WriteOpenBraceAndIndent(); WriteLine($"var nativeSpan = context.AllocateNative<{@class.NativeStruct.FullName}>(1);"); WriteLine($"var dataCursor = context.GetDataCursor();"); WriteLine($"var internalContext = new MarshallingContext<{@class.NativeStruct.FullName}>(nativeSpan, dataCursor);"); WriteLine($"this.MarshalTo(ref internalContext);"); WriteLine($"context.SetDataCursor(internalContext.DataCursor);"); - WriteLine($"return (nuint){UnsafeClassName}.AsPointer(ref nativeSpan[0]);"); + WriteLine($"return {UnsafeClassName}.AsPointer(ref nativeSpan[0]);"); UnindentAndWriteCloseBrace(); } @@ -241,7 +241,7 @@ private void GenerateGetSizeMethod(Class @class) WriteLine($"size += MarshalContextUtils.CalculateRequiredSizeForStringArray({property.Name});"); } } - else if (property.Type.IsPointerToArray()) + else if (property.Type.IsPointerToArray(out var arrayType, out var depth)) { if (property.Type.IsConstArray()) continue; @@ -340,6 +340,11 @@ private void GenerateGetSizeMethod(Class @class) } else if (property.Type.IsPointerToArrayOfPrimitiveTypes(out var primitiveType)) { + if (primitiveType.Type == PrimitiveType.Void) + { + primitiveType.Type = PrimitiveType.Nuint; + } + if (TargetRuntime == TargetRuntime.Net8Plus) { WriteLine($"if (!{property.Name}.IsEmpty)"); @@ -357,6 +362,13 @@ private void GenerateGetSizeMethod(Class @class) NewLine(); PopIndent(); } + else if (depth >= 2 && arrayType.ElementType.IsPrimitiveType) + { + WriteLine($"if (!{property.Name}.IsEmpty)"); + PushIndent(); + WriteLine($"size += Marshal.SizeOf();"); + PopIndent(); + } } else if (property.Type.IsPointerToWrapper(out var wrapper)) { @@ -372,6 +384,13 @@ private void GenerateGetSizeMethod(Class @class) WriteLine($"size += Marshal.SizeOf<{property.Type.Declaration.FullName}>();"); UnindentAndWriteCloseBrace(); } + else if (property.Type.IsDoublePointer()) + { + WriteLine($"if (!{property.Name}.IsEmpty)"); + PushIndent(); + WriteLine($"size += Marshal.SizeOf();"); + PopIndent(); + } } WriteLine($"return size;"); UnindentAndWriteCloseBrace(); @@ -389,7 +408,7 @@ private void GenerateMarshalFromMethod(Class @class) { WriteLine($"public void {MarshalFromMethodName}(in {@class.NativeStruct.FullName} {@class.NativeStructFieldName})"); WriteOpenBraceAndIndent(); - GenerateNativeToManagedCode(@class); + GenerateNativeToManagedTransition(@class); UnindentAndWriteCloseBrace(); } @@ -407,14 +426,15 @@ private void GenerateMarshallerCtor(Class @class) @class.InputClassName = $"{@class.Name[0].ToString().ToLower()}{@class.Name.Substring(1)}"; WriteLine($"public {@class.MarshalerStructName}({@class.FullName} {@class.InputClassName}, ref {MarshalContextClassName}<{@class.NativeStruct.FullName}> context)"); WriteOpenBraceAndIndent(); - GenerateManagedToNativeCode(@class, contextName); + GenerateManagedToNativeTransition(@class, contextName); UnindentAndWriteCloseBrace(); } - protected virtual void GenerateNativeToManagedCode(Class @class) + protected virtual void GenerateNativeToManagedTransition(Class @class) { PushBlock(CodeBlockKind.Constructor); int constArrayIndex = 0; + foreach (var property in @class.Properties) { TypePrinter.PushMarshalType(MarshalTypes.WrappedProperty); @@ -427,12 +447,12 @@ protected virtual void GenerateNativeToManagedCode(Class @class) { if (!property.Field.IsPredefinedValueReadOnly) { - WriteLine($"{property.Name} = {property.Field.PredefinedValue};"); + WriteLine($"{property.Name} = {property.Field.GetPredefinedValue()};"); } continue; } - + if (property.Type.IsPointer()) { if (property.Type.IsStringArray(out var isUnicode)) @@ -443,20 +463,27 @@ protected virtual void GenerateNativeToManagedCode(Class @class) { WriteLine($"{property.Name} = new string({@class.NativeStructFieldName}.{property.Field.Name});"); } - else if (property.Type.IsPointerToArray()) + else if (property.Type.IsPointerToArray(out var arrayType, out var depth)) { - MarshalFromPointerToArray(property, @class, constArrayIndex++); + if (depth == 1) + { + MarshalFromPointerToArray(property, @class, constArrayIndex++); + } + else if (depth == 2) + { + MarshalFromDoublePointerToManagedArray(property, @class, constArrayIndex++); + } } else if (property.Type.IsPointerToObject()) { WriteLine($"{property.Name} = (System.IntPtr){@class.NativeStructFieldName}.{property.Field.Name};"); } else if (property.Type.IsDoublePointer() || - property.Type.IsPointerToVoid() || + property.Type.IsPointerToVoid(out var pointerDepth) || property.Type.IsPointerToIntPtr() || property.Type.IsPointerToSystemType(out var systemType)) { - WriteLine($"{property.Name} = {@class.NativeStructFieldName}.{property.Field.Name};"); + WriteLine($"{property.Name} = ({PrimitiveType.Nuint.GetDisplayName()}){@class.NativeStructFieldName}.{property.Field.Name};"); } else if (property.Type.IsPointerToEnum() || property.Type.IsEnum()) { @@ -518,7 +545,7 @@ void FromNativeToManaged(BuiltinType builtin) PopBlock(); } - protected virtual void GenerateManagedToNativeCode(Class @class, string contextName) + protected virtual void GenerateManagedToNativeTransition(Class @class, string contextName) { int structIndex = 0; int pointerArrayIndex = 0; @@ -534,14 +561,10 @@ protected virtual void GenerateManagedToNativeCode(Class @class, string contextN { continue; } - + if (property.Type.IsPointer()) { - if (property.Type.IsPointerToVoid() || property.Type.IsPointerToIntPtr() || property.Type.IsPointerToSystemType(out var systemType)) - { - WriteLine($"{contextName}.Destination[0].{property.Field.Name} = {@class.InputClassName}.{property.Name};"); - } - else if (property.Type.IsPointerToArrayOfEnums() || property.Type.IsPointerToEnum()) + if (property.Type.IsPointerToArrayOfEnums() || property.Type.IsPointerToEnum()) { MarshalPointerToEnum(property, @class, contextName); } @@ -565,11 +588,11 @@ protected virtual void GenerateManagedToNativeCode(Class @class, string contextN } WriteOpenBraceAndIndent(); - WriteLine($"{contextName}.Destination[0].{property.Field.Name} = (nuint)ptr;"); + WriteLine($"{contextName}.Destination[0].{property.Field.Name} = (void*)ptr;"); UnindentAndWriteCloseBrace(); WriteLine($"else if ({@class.InputClassName}.{property.Name} is nuint nPtr)"); WriteOpenBraceAndIndent(); - WriteLine($"{contextName}.Destination[0].{property.Field.Name} = (nuint)nPtr;"); + WriteLine($"{contextName}.Destination[0].{property.Field.Name} = (void*)nPtr;"); UnindentAndWriteCloseBrace(); NewLine(); @@ -581,7 +604,7 @@ protected virtual void GenerateManagedToNativeCode(Class @class, string contextN { WriteLine($"if ({@class.InputClassName}.{property.Name}.HasValue)"); } - else if (property.Type.IsPointerToArray()) + else if (property.Type.IsPointerToArray() || property.Type.IsDoublePointer()) { if (TargetRuntime == TargetRuntime.Net8Plus) { @@ -610,9 +633,17 @@ protected virtual void GenerateManagedToNativeCode(Class @class, string contextN MarshalStringToPointer(property, @class, contextName); } } - else if (property.Type.IsPointerToArray()) + else if (property.Type.IsPointerToArray(out var arrayType, out var ptrDepth)) { - MarshalFromArrayToPointer(property, @class, contextName); + switch (ptrDepth) + { + case 1: + MarshalFromArrayToPointer(property, @class, contextName); + break; + case 2: + MarshalFromArrayToDoublePointer(property, @class, contextName); + break; + } } else if (property.Type.IsPointerToIntPtr()) { @@ -621,10 +652,11 @@ protected virtual void GenerateManagedToNativeCode(Class @class, string contextN TypePrinter.PopMarshalType(); WriteLine($"{contextName}.Destination[0].{property.Field.Name} = ({fieldResult}){@class.InputClassName}.{property.Name};"); } - else if (property.Type.IsDoublePointer() || property.Type.IsPointerToVoid()) + else if (property.Type.IsPurePointer() || property.Type.IsPointerToSystemType(out var systemType)) { - WriteLine( - $"{contextName}.Destination[0].{property.Field.Name} = {@class.InputClassName}.{property.Name};"); + var pointer = (PointerType)property.Type; + var depth = pointer.GetDepth(); + WriteLine($"{contextName}.Destination[0].{property.Field.Name} = (void{TextGenerator.GetPointerString(depth)}){@class.InputClassName}.{property.Name};"); } else // pointer to struct and pointer to simple types { @@ -746,7 +778,7 @@ protected override void GenerateConstructor(Constructor ctor) { if (property.Field.HasPredefinedValue && !property.Field.IsPredefinedValueReadOnly) { - WriteLine($"{property.Name} = {property.Field.PredefinedValue};"); + WriteLine($"{property.Name} = {property.Field.GetPredefinedValue()};"); } } UnindentAndWriteCloseBrace(); @@ -921,7 +953,7 @@ private void GenerateWrappedProperties(Class @class) { if (property.Field.IsPredefinedValueReadOnly) { - WriteLine($"{propertyTypeName} {property.Name} => {property.Field.PredefinedValue};"); + WriteLine($"{propertyTypeName} {property.Name} => {property.Field.GetPredefinedValue()};"); PopBlock(); continue; } @@ -1024,6 +1056,10 @@ private void MarshalFromPointerToArray(Property property, Class parentClass, int var arrayPtr = $"{parentClass.NativeStructFieldName}.{property.Field.Name}"; var arraySizeFieldName = $"{parentClass.NativeStructFieldName}.{arrayType.ArraySizeSource}"; + if (arrayType.HasMathExpression) + { + arraySizeFieldName = arrayType.MathExpression.Replace(arrayType.ArraySizeSource, $"(uint){parentClass.NativeStructFieldName}.{arrayType.ArraySizeSource}"); + } TypePrinter.PushMarshalType(MarshalTypes.WrappedProperty); arrayType.ElementType.Declaration = property.Type.Declaration; var arrayElementType = arrayType.ElementType.Visit(TypePrinter); @@ -1031,35 +1067,86 @@ private void MarshalFromPointerToArray(Property property, Class parentClass, int TypePrinter.PushMarshalType(MarshalTypes.NativeField); var nativeArrayType = property.Field.Type.Visit(TypePrinter); TypePrinter.PopMarshalType(); + string arrayLengthName = $"arrayLength{property.Name}"; + WriteLine($"var {arrayLengthName} = {arraySizeFieldName};"); string tempArrayName = $"tmp{property.Name}"; - WriteLine($"var {tempArrayName} = new {arrayElementType}[{arraySizeFieldName}];"); + WriteLine($"var {tempArrayName} = new {arrayElementType}[{arrayLengthName}];"); var nativeArrayName = $"nativeTmpArray{index}"; if (pointerType.Declaration is Class { IsSimpleType: false } classDecl) { - WriteLine($"var {nativeArrayName} = new {parentClass.NativeStruct.Namespace}.{nativeArrayType.Type}[{arraySizeFieldName}];"); - WriteLine($"{TextGenerator.MarshalFromPointerToArray}({arrayPtr}, {arraySizeFieldName}, {nativeArrayName});"); + var @namespace = classDecl.NativeStruct.Namespace; + WriteLine($"var {nativeArrayName} = new {@namespace}.{nativeArrayType.Type}[{arrayLengthName}];"); + WriteLine($"{TextGenerator.MarshalFromPointerToArray}({arrayPtr}, {arrayLengthName}, {nativeArrayName});"); WriteLine($"for (int i = 0; i < {nativeArrayName}.{CounterProperty}; ++i)"); WriteOpenBraceAndIndent(); WriteLine($"{tempArrayName}[i] = new {classDecl.Name}(in {nativeArrayName}[i]);"); UnindentAndWriteCloseBrace(); - WriteLine($"{property.Name} = {tempArrayName};"); } else if (arrayType.ElementType.IsPrimitiveType(out var primitive) && primitive is PrimitiveType.Bool32 or PrimitiveType.Bool) { - WriteLine($"var {nativeArrayName} = new {nativeArrayType}[{arraySizeFieldName}];"); - WriteLine($"{TextGenerator.MarshalFromPointerToArray}({arrayPtr}, {arraySizeFieldName}, {nativeArrayName});"); + WriteLine($"var {nativeArrayName} = new {nativeArrayType}[{arrayLengthName}];"); + WriteLine($"{TextGenerator.MarshalFromPointerToArray}({arrayPtr}, {arrayLengthName}, {nativeArrayName});"); WriteLine($"for (int i = 0; i < {nativeArrayName}.{CounterProperty}; ++i)"); WriteOpenBraceAndIndent(); WriteLine($"{tempArrayName}[i] = System.Convert.ToBoolean({nativeArrayName}[i]);"); UnindentAndWriteCloseBrace(); - WriteLine($"{property.Name} = {tempArrayName};"); } else { - WriteLine($"{TextGenerator.MarshalFromPointerToArray}({arrayPtr}, {arraySizeFieldName}, {tempArrayName});"); + WriteLine($"{TextGenerator.MarshalFromPointerToArray}({arrayPtr}, {arrayLengthName}, {tempArrayName});"); } + WriteLine($"{property.Name} = {tempArrayName};"); + } + + private void MarshalFromDoublePointerToManagedArray(Property property, Class parentClass, int index) + { + var pointerType = property.Type as PointerType; + if (pointerType == null) return; + + var depth = pointerType.GetDepth(); + + var bindingType = pointerType.GetBindingType(); + + var arrayType = bindingType as ArrayType; + if (arrayType == null || string.IsNullOrEmpty(arrayType.ArraySizeSource)) + return; + + var arrayPtr = $"{parentClass.NativeStructFieldName}.{property.Field.Name}"; + var arraySizeFieldName = $"{parentClass.NativeStructFieldName}.{arrayType.ArraySizeSource}"; + if (arrayType.HasMathExpression) + { + arraySizeFieldName = arrayType.MathExpression.Replace(arrayType.ArraySizeSource, $"(uint){parentClass.NativeStructFieldName}.{arrayType.ArraySizeSource}"); + } + TypePrinter.PushMarshalType(MarshalTypes.WrappedProperty); + arrayType.ElementType.Declaration = property.Type.Declaration; + var arrayElementType = arrayType.ElementType.Visit(TypePrinter); + if (arrayElementType.Type == "void") + { + arrayElementType.Type = PrimitiveType.Nuint.GetDisplayName(); + } + TypePrinter.PopMarshalType(); + TypePrinter.PushMarshalType(MarshalTypes.NativeField); + var nativeArrayType = property.Field.Type.Visit(TypePrinter); + TypePrinter.PopMarshalType(); + + WriteLine($"if ({parentClass.NativeStructFieldName}.{property.Field.Name} != null && {arraySizeFieldName} > 0)"); + WriteOpenBraceAndIndent(); + + string arrayLengthName = $"arrayLength{property.Name}"; + WriteLine($"var {arrayLengthName} = {arraySizeFieldName};"); + string tempArrayName = $"tmp{property.Name}"; + WriteLine($"var {tempArrayName} = new {arrayElementType}[{arrayLengthName}];"); + WriteLine($"var ptrArray = {parentClass.NativeStructFieldName}.{property.Field.Name};"); + + WriteLine($"for (int i = 0; i < (int){arrayLengthName}; ++i)"); + PushIndent(); + WriteLine($"{tempArrayName}[i] = (nuint)(ptrArray[i]);"); + PopIndent(); + + WriteLine($"{property.Name} = {tempArrayName};"); + UnindentAndWriteCloseBrace(); } private void WriteFreeMemory(string pointer) @@ -1091,8 +1178,8 @@ private void MarshalFixedArrayToManaged(Property property, Class parentClass, Cl TypePrinter.PushMarshalType(MarshalTypes.NativeField); var nativeType = property.Field.Type.Visit(TypePrinter); TypePrinter.PopMarshalType(); - - if (arrayType.ElementType.CanConvertToFixedArray()) + + if (arrayType.ElementType.CanConvertToFixedArray() || arrayType.ElementType.IsSimpleType()) { var arrayName = $"{parentClass.NativeStructFieldName}.{property.Field.Name}"; @@ -1120,7 +1207,8 @@ private void MarshalFixedArrayToManaged(Property property, Class parentClass, Cl string tempArrayName = $"tmp{property.Name}"; WriteLine($"var {tempArrayName} = new {managedType.Type}[{size}];"); - WriteLine($"var p{property.Name} = ({managedType.Type}*){UnsafeClassName}.AsPointer(ref {UnsafeClassName}.AsRef(in {parentClass.NativeStructFieldName}.{property.Field.Name}[0]));"); + WriteLine($"var {property.Field.Name}p = {parentClass.NativeStructFieldName}.{property.Field.Name}[0];"); + WriteLine($"var p{property.Name} = ({managedType.Type}*){UnsafeClassName}.AsPointer(ref {UnsafeClassName}.AsRef(in {property.Field.Name}p ));"); WriteLine($"{TextGenerator.MarshalFromPointerToArray}(p{property.Name}, {size}, {tempArrayName});"); WriteLine($"{property.Name} = {tempArrayName};"); } @@ -1160,14 +1248,27 @@ private void MarshalFixedArrayToManaged(Property property, Class parentClass, Cl WriteLine($"var {tempArrayName} = new {propertyArrayElementType}[{size}];"); WriteLine($"var p{property.Name} = ({nativeType.Type}*){UnsafeClassName}.AsPointer(ref {UnsafeClassName}.AsRef(in {parentClass.NativeStructFieldName}.{property.Field.Name}));"); - if (decl.LinkedTo is { ClassType: ClassType.Class }) + if (decl.LinkedTo is { ClassType: ClassType.Class } || decl.ClassType == ClassType.Class) { string spanName = $"span{property.Name}"; - WriteLine($"var {spanName} = new {ReadonlySpanClassName}<{decl.FullName}>(p{property.Name}, {size});"); + var fullName = decl.FullName; + if (decl.ClassType == ClassType.Class) + { + fullName = decl.NativeStruct.FullName; + } + + var classFullname = decl.FullName; + if (decl.LinkedTo != null && decl.ClassType != ClassType.Class) + { + classFullname = decl.LinkedTo.FullName; + } + + WriteLine($"var {spanName} = new {ReadonlySpanClassName}<{fullName}>(p{property.Name}, {size});"); WriteLine($"for (int i = 0; i < {size}; ++i)"); WriteOpenBraceAndIndent(); - WriteLine($"{tempArrayName}[i] = new {decl.LinkedTo.FullName}({spanName}[i]);"); + WriteLine($"{tempArrayName}[i] = new {classFullname}({spanName}[i]);"); UnindentAndWriteCloseBrace(); + WriteLine($"{property.Name} = {tempArrayName};"); } else { @@ -1299,55 +1400,36 @@ private void MarshalFromArrayToPointer(Property property, Class @class, string c WriteLine($"{contextName}.Destination[0].{property.Field.Name} = {TextGenerator.MarshalArrayToPointer}<{@class.Namespace}.{managedArrayTypeName}, {castTypeName}, {@class.NativeStruct.FullName}>({@class.InputClassName}.{property.Name}, ref {contextName});"); } - - /* - WriteLine($"var {sizeInBytes} = sizeof({castTypeName}) * {@class.InputClassName}.{property.Name}.{CounterProperty};"); - WriteLine($"var {byteSpan} = {contextName}.AllocateData({sizeInBytes});"); - WriteLine($"var {tmpSpanName} = {MemoryMarshalClassName}.Cast({byteSpan});"); - WriteLine($"{contextName}.Destination[0].{property.Field.Name} = ({castTypeName}*){UnsafeClassName}.AsPointer(ref {MemoryMarshalClassName}.GetReference({tmpSpanName}));"); + } + + private void MarshalFromArrayToDoublePointer(Property property, Class @class, string contextName) + { + var pointerType = property.Type as PointerType; + if (pointerType == null) return; + + var depth = pointerType.GetDepth(); - WriteLine($"for (int i = 0; i < {@class.InputClassName}.{property.Name}.{CounterProperty}; ++i)"); - WriteOpenBraceAndIndent(); - if (decl != null && (decl.ClassType == ClassType.Class || decl.IsSimpleType) - || property.Type.IsPointerToArrayOfPrimitiveTypes()) - { - if (property.Type.IsPointerToArrayOfPrimitiveTypes(out var primitive) && primitive.Type == PrimitiveType.Bool32) - { - string conversionName = string.Empty; - if (array.ElementType is BuiltinType builtinType) - { - switch (builtinType.Type) - { - case PrimitiveType.Bool32: - case PrimitiveType.UInt32: - conversionName = "System.Convert.ToUInt32"; - break; - case PrimitiveType.Int32: - conversionName = "System.Convert.ToInt32"; - break; - case PrimitiveType.Float: - conversionName = "System.Convert.ToSingle"; - break; - } - } + var bindingType = pointerType.GetBindingType(); + + var arrayType = bindingType as ArrayType; + if (arrayType == null || string.IsNullOrEmpty(arrayType.ArraySizeSource)) + return; + + TypePrinter.PushMarshalType(MarshalTypes.NativeField); + arrayType.ElementType.Declaration = property.Field.Type.Declaration; + var arrayTypeName = arrayType.ElementType.Visit(TypePrinter); + TypePrinter.PopMarshalType(); - WriteLine($"{tmpSpanName}[i] = ({conversionName}){property.Name}[i];"); - } - else - { - WriteLine($"{tmpSpanName}[i] = {@class.InputClassName}.{property.Name}[i];"); - } - } - else + if (arrayTypeName.Type == "void") { - string destinationName = "destinationSlice"; - WriteLine($"var {destinationName} = {tmpSpanName}.Slice(i, 1);"); - WriteLine($"var innerContext = new {MarshalContextClassName}<{decl.FullName}>({destinationName}, {contextName}.DataCursor);"); - WriteLine($"{@class.InputClassName}.{property.Name}[i].{MarshalMethodName}(ref innerContext);"); - WriteLine($"{contextName}.DataCursor = innerContext.DataCursor;"); + arrayTypeName.Type = PrimitiveType.Nuint.GetDisplayName(); } - UnindentAndWriteCloseBrace(); - */ + + string sourceSpan = $"src{property.Name}"; + WriteLine($"var {sourceSpan} = {@class.InputClassName}.{property.Name}.Span;"); + WriteLine($"var allocatedSpan = {contextName}.AllocateNative<{arrayTypeName}>({sourceSpan}.Length);"); + WriteLine($"{sourceSpan}.CopyTo(allocatedSpan);"); + WriteLine($"{contextName}.Destination[0].{property.Field.Name} = (void{TextGenerator.GetPointerString(depth)}){UnsafeClassName}.AsPointer(ref allocatedSpan[0]);"); } private void MarshalConstArrayToNative(Property property, Class @class, Class decl, string contextName, ref int increment) @@ -1364,10 +1446,10 @@ private void MarshalConstArrayToNative(Property property, Class @class, Class de TypePrinter.PushMarshalType(MarshalTypes.WrappedProperty); var result = arrayType.ElementType.Visit(TypePrinter); TypePrinter.PopMarshalType(); - + var destinationFieldName = $"tmpDestination{increment++}"; var fieldName = $"{property.Field.Name}"; - if (arrayType.ElementType.CanConvertToFixedArray()) + if (arrayType.ElementType.CanConvertToFixedArray() || arrayType.ElementType.IsSimpleType()) { if (arrayType.ElementType.IsPrimitiveTypeEquals(PrimitiveType.SChar) || arrayType.ElementType.IsPrimitiveTypeEquals(PrimitiveType.WideChar)) @@ -1385,10 +1467,20 @@ private void MarshalConstArrayToNative(Property property, Class @class, Class de else { WriteLine($"ref var {destinationFieldName} = ref {contextName}.Destination[0];"); - WriteLine($"fixed ({result}* pDest = {destinationFieldName}.{fieldName})"); - WriteOpenBraceAndIndent(); - WriteLine($"{TextGenerator.MarshalFixedArrayToPointer}({@class.InputClassName}.{property.Name}.Span, pDest, {size});"); - UnindentAndWriteCloseBrace(); + if (decl is { IsSimpleType: true }) + { + WriteLine($"fixed (void* pDest = &{destinationFieldName}.{fieldName}.item0)"); + WriteOpenBraceAndIndent(); + WriteLine($"{TextGenerator.MarshalFixedArrayToPointer}({@class.InputClassName}.{property.Name}.Span, ({result}*)pDest, {size});"); + UnindentAndWriteCloseBrace(); + } + else + { + WriteLine($"fixed ({result}* pDest = {destinationFieldName}.{fieldName})"); + WriteOpenBraceAndIndent(); + WriteLine($"{TextGenerator.MarshalFixedArrayToPointer}({@class.InputClassName}.{property.Name}.Span, pDest, {size});"); + UnindentAndWriteCloseBrace(); + } } } else if (arrayType.ElementType.IsPurePointer()) @@ -1416,12 +1508,11 @@ private void MarshalConstArrayToNative(Property property, Class @class, Class de } else // Fixed array of structs { - TypePrinter.PushMarshalType(MarshalTypes.Property); + TypePrinter.PushMarshalType(MarshalTypes.NativeField); var propType = arrayType.ElementType.Visit(TypePrinter); TypePrinter.PopMarshalType(); - if (decl != null && !string.IsNullOrEmpty(decl.Namespace) && - decl.Name == propType.Type) + if (decl != null) { result = $"{InteropNamespace}.{propType}"; } @@ -1439,13 +1530,13 @@ private void MarshalConstArrayToNative(Property property, Class @class, Class de string pointerName = $"p{property.Name}"; WriteLine($"var {pointerName} = ({result}*){UnsafeClassName}.AsPointer(ref {fixedFieldName}.item0);"); - if (decl is { LinkedTo.ClassType: ClassType.Class }) + if (decl is { LinkedTo.ClassType: ClassType.Class } || decl.ClassType == ClassType.Class) { - WriteLine($"{TextGenerator.MarshalArrayOfHandleWrappersToFixedBuffer}({fixedFieldName}Span , {pointerName}, {size});"); + WriteLine($"{TextGenerator.MarshalArrayOfHandleWrappersToFixedBuffer}({fixedFieldName}Span, {pointerName}, {size});"); } else { - WriteLine($"{TextGenerator.MarshalArrayOfWrappersToFixedBuffer}({fixedFieldName}Span , {pointerName}, {size}, ref {contextName}.DataCursor);"); + WriteLine($"{TextGenerator.MarshalArrayOfWrappersToFixedBuffer}({fixedFieldName}Span, {pointerName}, {size}, ref {contextName}.DataCursor);"); } } } diff --git a/QuantumBinding.Generator/Extensions/StringExtensions.cs b/QuantumBinding.Generator/Extensions/StringExtensions.cs new file mode 100644 index 0000000..d246db4 --- /dev/null +++ b/QuantumBinding.Generator/Extensions/StringExtensions.cs @@ -0,0 +1,47 @@ +using System.Text; + +namespace QuantumBinding.Generator.Extensions; + +public static class StringExtensions +{ + public static string ToSnakeCase(this string input) + { + if (string.IsNullOrEmpty(input)) return input; + + var sb = new StringBuilder(); + for (int i = 0; i < input.Length; i++) + { + char c = input[i]; + + if (i > 0) + { + char prev = input[i - 1]; + + if ((char.IsLower(prev) && char.IsUpper(c)) || + (char.IsDigit(prev) && char.IsUpper(c)) || + (char.IsLetter(prev) && char.IsDigit(c))) + { + sb.Append('_'); + } + else if (i < input.Length - 1 && char.IsUpper(prev) && char.IsUpper(c) && char.IsLower(input[i + 1])) + { + sb.Append('_'); + } + } + + sb.Append(char.ToUpper(c)); + } + + string result = sb.ToString(); + + if (result.StartsWith("VK_") == false && result.StartsWith("VK")) + { + if (result.StartsWith("V_K")) + result = "VK_" + result.Substring(3); + else + result = "VK_" + result.Substring(2); + } + + return result; + } +} \ No newline at end of file diff --git a/QuantumBinding.Generator/FileLocation.cs b/QuantumBinding.Generator/FileLocation.cs index 32f56f9..0901bac 100755 --- a/QuantumBinding.Generator/FileLocation.cs +++ b/QuantumBinding.Generator/FileLocation.cs @@ -12,8 +12,16 @@ public class FileLocation public uint Column { get; set; } + public bool IsFakeFileName => !string.IsNullOrEmpty(RealFileName); + + public string RealFileName { get; set; } + public override string ToString() { + if (IsFakeFileName) + { + return $"File: {RealFileName} Line: {LineNumber} Column: {Column}"; + } return $"File: {FileName} Line: {LineNumber} Column: {Column}"; } } \ No newline at end of file diff --git a/QuantumBinding.Generator/IDeclarationVisitor.cs b/QuantumBinding.Generator/IDeclarationVisitor.cs index 5b4a002..ff7fb66 100755 --- a/QuantumBinding.Generator/IDeclarationVisitor.cs +++ b/QuantumBinding.Generator/IDeclarationVisitor.cs @@ -4,6 +4,9 @@ namespace QuantumBinding.Generator; public interface IDeclarationVisitor { + T VisitGlobalUsings(GlobalUsings globalUsings); + T VisitGlobalUsingItem(GlobalUsingItem item); + T VisitDispatchTable(DispatchTable dispatchTable); T VisitEnum(Enumeration enumeration); T VisitEnumItem(EnumerationItem item); T VisitFunction(Function function); diff --git a/QuantumBinding.Generator/Parser/Clang/ClangParser.cs b/QuantumBinding.Generator/Parser/Clang/ClangParser.cs index 9eec932..5ef8577 100644 --- a/QuantumBinding.Generator/Parser/Clang/ClangParser.cs +++ b/QuantumBinding.Generator/Parser/Clang/ClangParser.cs @@ -32,7 +32,7 @@ public ClangParser(QBIndex index) private Delegates.CXCursorVisitor _visitor; private Delegates.CXCursorVisitor _functionPtr; - public ParseResult Parse(TranslationUnit unit, string filePath) + public ParseResult Parse(TranslationUnit unit, string vulkanFile) { _unit = unit; var arguments = GetArguments(); @@ -43,7 +43,7 @@ public ParseResult Parse(TranslationUnit unit, string filePath) { QBUnsavedFile[] unsavedFile = Array.Empty(); var translationUnitResult = _index.ParseTranslationUnit2( - filePath, + vulkanFile, arguments.ToArray(), arguments.Count, unsavedFile, @@ -299,7 +299,6 @@ private CXChildVisitResult VisitStruct(QBCursor cursor, QBCursor parent, QBClien _functionPtr = VisitStructFieldsNative; cursor.VisitChildren((nuint)Marshal.GetFunctionPointerForDelegate(_functionPtr).ToPointer(), new QBClientData()); - //cursor.VisitChildren(Marshal.GetFunctionPointerForDelegate(_functionPtr).ToPointer(), new QBClientData()); CXChildVisitResult VisitStructFieldsNative(CXCursor cursor, CXCursor parent, CXClientDataImpl data) { @@ -530,7 +529,6 @@ private CXChildVisitResult VisitTypedef(QBCursor cursor, QBCursor parent, QBClie _functionPtr = VisitFunctionProtoNative; cursor.VisitChildren((nuint)Marshal.GetFunctionPointerForDelegate(_functionPtr).ToPointer(), new QBClientData()); - //cursor.VisitChildren(Marshal.GetFunctionPointerForDelegate(_functionPtr).ToPointer(), new QBClientData()); CXChildVisitResult VisitFunctionProtoNative(CXCursor cxCursor, CXCursor parent, CXClientDataImpl clientData) { @@ -614,12 +612,12 @@ private CXChildVisitResult VisitFunction(QBCursor cursor, QBCursor parent, QBCli { var functionName = cursor.GetCursorSpelling().ToString(); - if (this._visitedFunctions.Contains(functionName)) + if (_visitedFunctions.Contains(functionName)) { return CXChildVisitResult.CXChildVisit_Continue; } - this._visitedFunctions.Add(functionName); + _visitedFunctions.Add(functionName); var function = ClangUtils.GetFunctionInfo(cursor); function.Comment = GetComment(cursor); function.Location = ClangUtils.GetCurrentCursorLocation(cursor); diff --git a/QuantumBinding.Generator/Parser/IMetadataProvider.cs b/QuantumBinding.Generator/Parser/IMetadataProvider.cs index df242d5..4cc5183 100644 --- a/QuantumBinding.Generator/Parser/IMetadataProvider.cs +++ b/QuantumBinding.Generator/Parser/IMetadataProvider.cs @@ -5,5 +5,5 @@ namespace QuantumBinding.Generator.Parser; public interface IMetadataProvider : IDisposable { - ParseResult Parse(TranslationUnit unit, string source); + ParseResult Parse(TranslationUnit unit, string vulkanFile); } \ No newline at end of file diff --git a/QuantumBinding.Generator/PrimitiveType.cs b/QuantumBinding.Generator/PrimitiveType.cs index eb42fb9..01f3f7d 100755 --- a/QuantumBinding.Generator/PrimitiveType.cs +++ b/QuantumBinding.Generator/PrimitiveType.cs @@ -52,7 +52,9 @@ public enum PrimitiveType String = 22, [Display(Name = "object")] Object = 23, + [Display(Name = "nuint")] + Nuint = 24, [Display(Name = "(unknown)")] - Unknown = 24, + Unknown = 25, } \ No newline at end of file diff --git a/QuantumBinding.Generator/ProcessingFluentApi/PostProcessingApi.Classes.cs b/QuantumBinding.Generator/ProcessingFluentApi/PostProcessingApi.Classes.cs index c290aa2..63d01d4 100755 --- a/QuantumBinding.Generator/ProcessingFluentApi/PostProcessingApi.Classes.cs +++ b/QuantumBinding.Generator/ProcessingFluentApi/PostProcessingApi.Classes.cs @@ -448,7 +448,7 @@ public ISetField InterpretAsCustomType(string typeName) public ISetField InterpretAsDelegateType(IEnumerable parameters, string name) { - _currentField.Type = new DelegateType() { Name = name, Parameters = new List(parameters)}; + _currentField.Type = new DelegateType() { Name = name, Parameters = [..parameters] }; return this; } diff --git a/QuantumBinding.Generator/Processors/BasicCodeGeneratorPass.cs b/QuantumBinding.Generator/Processors/BasicCodeGeneratorPass.cs index 84b1193..216e7c2 100644 --- a/QuantumBinding.Generator/Processors/BasicCodeGeneratorPass.cs +++ b/QuantumBinding.Generator/Processors/BasicCodeGeneratorPass.cs @@ -23,6 +23,10 @@ protected override List ProcessPerTypeCodeGeneration(TranslationU { switch (specializations) { + case GeneratorSpecializations.GlobalUsings: + var globalUsingsGenerator = OnCreateGenerator(GeneratorCategory.GlobalUsings, unit); + globalUsingsGenerator.Run(); + return new List() { globalUsingsGenerator }; case GeneratorSpecializations.Enums: return ProcessDeclarations(unit.Enums, unit); case GeneratorSpecializations.Delegates: diff --git a/QuantumBinding.Generator/Processors/CheckMacrosPass.cs b/QuantumBinding.Generator/Processors/CheckMacrosPass.cs index d3d301e..904c00f 100755 --- a/QuantumBinding.Generator/Processors/CheckMacrosPass.cs +++ b/QuantumBinding.Generator/Processors/CheckMacrosPass.cs @@ -1,4 +1,5 @@ using QuantumBinding.Generator.AST; +using QuantumBinding.Generator.Types; using QuantumBinding.Generator.Utils; namespace QuantumBinding.Generator.Processors; @@ -27,7 +28,14 @@ public override bool VisitMacro(Macro macro) macro.Value = macro.Value[1..^1]; } - macro.Type = ClangUtils.GetMacroType(macro.Value); + if (macro.PrimitiveType != PrimitiveType.Unknown && macro.PrimitiveType != PrimitiveType.None) + { + macro.Type = new BuiltinType(macro.PrimitiveType); + } + else + { + macro.Type = ClangUtils.GetMacroType(macro.Value); + } return true; } diff --git a/QuantumBinding.Generator/Processors/DispatchTableProcessorPass.cs b/QuantumBinding.Generator/Processors/DispatchTableProcessorPass.cs new file mode 100644 index 0000000..f9b7257 --- /dev/null +++ b/QuantumBinding.Generator/Processors/DispatchTableProcessorPass.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; +using System.Linq; +using QuantumBinding.Generator.AST; +using QuantumBinding.Generator.Types; + +namespace QuantumBinding.Generator.Processors; + +public class DispatchTableProcessorPass : PreGeneratorPass +{ + public DispatchTableProcessorPass() + { + Options.VisitDispatchTables = true; + } + + public override bool VisitDispatchTable(DispatchTable dispatchTable) + { + if (IsVisited(dispatchTable)) + return false; + + var handles = dispatchTable.Metadata.Get>("Handles"); + + foreach (var handle in handles) + { + var classHandle = CurrentNamespace.Classes.FirstOrDefault(x=>x.Name == handle); + foreach (var method in classHandle.Methods) + { + if (method.IsOverload) + continue; + + var function = method.Function; + + if (dispatchTable.FunctionsToIgnore.Contains(function.Name)) + continue; + + var field = new Field(); + field.Name = function.Name; + var returnParameter = new Parameter(); + returnParameter.Type = function.ReturnType; + field.Type = new DelegateType() { Name = function.Name, Parameters = [..function.Parameters, returnParameter] }; + dispatchTable.AddField(field); + } + } + + return true; + } +} \ No newline at end of file diff --git a/QuantumBinding.Generator/Processors/EnumItemsCleanupPass.cs b/QuantumBinding.Generator/Processors/EnumItemsCleanupPass.cs index 4cb6598..38008d3 100644 --- a/QuantumBinding.Generator/Processors/EnumItemsCleanupPass.cs +++ b/QuantumBinding.Generator/Processors/EnumItemsCleanupPass.cs @@ -1,8 +1,5 @@ using QuantumBinding.Generator.AST; -using System; -using System.Collections.Generic; using System.Linq; -using System.Text; namespace QuantumBinding.Generator.Processors; @@ -18,11 +15,6 @@ public override bool VisitEnum(Enumeration enumeration) if (IsVisited(enumeration)) return false; - if (enumeration.Name == "VkSharingMode") - { - - } - var groupItems = enumeration.Items.GroupBy(x => x.Value).Where(group => group.Count() > 1); if (groupItems.Any()) diff --git a/QuantumBinding.Generator/Processors/EnumItemsRenamePass.cs b/QuantumBinding.Generator/Processors/EnumItemsRenamePass.cs index f0418fc..7b6c852 100755 --- a/QuantumBinding.Generator/Processors/EnumItemsRenamePass.cs +++ b/QuantumBinding.Generator/Processors/EnumItemsRenamePass.cs @@ -4,6 +4,7 @@ using System.Text; using QuantumBinding.Generator.AST; using QuantumBinding.Generator.CodeGeneration; +using QuantumBinding.Generator.Extensions; namespace QuantumBinding.Generator.Processors; @@ -27,37 +28,50 @@ public override bool VisitEnum(Enumeration enumeration) var enumItems = enumeration.Items.Where(x => !x.IsIgnored).ToList(); - var basicItem = enumItems.FirstOrDefault(); - if (basicItem == null) return false; + var firstItem = enumItems.FirstOrDefault(); + if (firstItem == null) return false; + + string firstName = firstItem.Name; + int commonLength = firstName.Length; - var basicName = basicItem.Name; - var finalName = string.Empty; - List shortenedNames = new List(); - - foreach (var item in enumItems) + if (enumItems.Count > 1) { - if (basicName == item.Name || item.IsIgnored) continue; - - var name = item.Name; - var tempName = string.Empty; - for (int i = 0; i < name.Length; ++i) + foreach (var item in enumItems.Skip(1)) { - if (i > basicName.Length - 1 || name[i] != basicName[i]) break; + int j = 0; + while (j < commonLength && j < item.Name.Length && firstName[j] == item.Name[j]) + { + j++; + } - tempName += name[i]; + commonLength = j; + if (commonLength == 0) break; } - - shortenedNames.Add(tempName); + } + else + { + string typePrefix = enumeration.Name.ToSnakeCase(); + + int j = 0; + while (j < firstName.Length && j < typePrefix.Length && firstItem.Name[j] == typePrefix[j]) + { + j++; + } + + int lastUnderscoreInMatch = firstName.Substring(0, j).LastIndexOf('_'); + commonLength = (lastUnderscoreInMatch != -1) ? lastUnderscoreInMatch + 1 : j; } - - finalName = shortenedNames.OrderBy(x => x.Length).FirstOrDefault(); - - if (enumItems.Count > 1 && !string.IsNullOrEmpty(finalName)) + if (commonLength > 0) { + string fullPrefix = firstName.Substring(0, commonLength); + int lastUnderscore = fullPrefix.LastIndexOf('_'); + + int finalPrefixLength = (lastUnderscore != -1) ? lastUnderscore + 1 : commonLength; + foreach (var enumItem in enumItems) { - enumItem.Name = enumItem.Name.Replace(finalName, ""); + enumItem.Name = enumItem.Name.Substring(finalPrefixLength); } } diff --git a/QuantumBinding.Generator/Processors/FunctionToInstanceMethodPass.cs b/QuantumBinding.Generator/Processors/FunctionToInstanceMethodPass.cs index 7172c58..8749355 100755 --- a/QuantumBinding.Generator/Processors/FunctionToInstanceMethodPass.cs +++ b/QuantumBinding.Generator/Processors/FunctionToInstanceMethodPass.cs @@ -128,6 +128,26 @@ public override bool VisitFunction(Function function) } } + //make changes to array size source in case if we have something like this: pAllocateInfo.descriptorSetCount -> pAllocateInfo.DescriptorSetCount + foreach (var methodParameter in method.Parameters) + { + if (methodParameter.Type.IsPointerToArray(out var arrayType, out var depth)) + { + if (!string.IsNullOrEmpty(arrayType.ArraySizeSource)) + { + if (arrayType.ArraySizeSource.Contains(".")) + { + var parameters = arrayType.ArraySizeSource.Split("."); + for(int i = 1; i< parameters.Length; ++i) + { + parameters[i] = parameters[i].Substring(0, 1).ToUpper() + parameters[i].Substring(1); + } + arrayType.ArraySizeSource = string.Join(".", parameters); + } + } + } + } + method.Class = @class; @class.AddMethod(method); @@ -186,7 +206,7 @@ private List GenerateMethodOverload(Method method) foreach (var param in method.Parameters) { if (!param.Type.IsPointerToArray() || param.ParameterKind is ParameterKind.Out) continue; - + parametersList.Add(param); var overloadedMethod = (Method)method.Clone(); @@ -195,33 +215,34 @@ private List GenerateMethodOverload(Method method) for (var index = 0; index < method.Parameters.Count; index++) { var parameter = method.Parameters[index]; - var parameterClone = (Parameter)parameter.Clone(); - - if (param == parameter) + var parameterClone = (Parameter)parameter.Clone(); + + if (param == parameter) + { + var typeClone = (PointerType)parameter.Type.Clone(); + var arrayType = typeClone.Pointee as ArrayType; + typeClone.Pointee = arrayType.ElementType; + typeClone.IsNullable = true; + parameterClone.Type = typeClone; + parameterClone.IsOverload = true; + + var functionParameter = method.Function.Parameters.FirstOrDefault(x => x.Name == parameter.Name); + if (functionParameter != null) { - var typeClone = (PointerType)parameter.Type.Clone(); - var arrayType = typeClone.Pointee as ArrayType; - typeClone.Pointee = arrayType.ElementType; - typeClone.IsNullable = true; - parameterClone.Type = typeClone; - parameterClone.IsOverload = true; - - var functionParameter = method.Function.Parameters.FirstOrDefault(x => x.Name == parameter.Name); - if (functionParameter != null) - { - var funcParamClone = (Parameter)parameterClone.Clone(); - funcParamClone.IsOverload = true; - overloadedMethod.Function.Parameters[(int)functionParameter.Index] = funcParamClone; - } + var funcParamClone = (Parameter)parameterClone.Clone(); + funcParamClone.IsOverload = true; + overloadedMethod.Function.Parameters[(int)functionParameter.Index] = funcParamClone; } - - parameterClone.IsOverload = true; - overloadedMethod.Parameters.Add(parameterClone); + } + + parameterClone.IsOverload = true; + overloadedMethod.Parameters.Add(parameterClone); } + methods.Add(overloadedMethod); } - + // Create last overload where all array parameters will be replaced to a single one // This is valid only if method contains more than 1 array parameter if (parametersList.Count > 1) diff --git a/QuantumBinding.Generator/Processors/LoadBindingsFromFilePass.cs b/QuantumBinding.Generator/Processors/LoadBindingsFromFilePass.cs index b0d7f8b..f29b41b 100755 --- a/QuantumBinding.Generator/Processors/LoadBindingsFromFilePass.cs +++ b/QuantumBinding.Generator/Processors/LoadBindingsFromFilePass.cs @@ -176,7 +176,7 @@ public override bool VisitClass(Class @class) { @class.UnderlyingNativeType = classFix.UnderlyingNativeType.ToBindingType(); } - + foreach (var fieldFix in classFix.Fields) { var field = @class.Fields.FirstOrDefault(x => x.Name == fieldFix.Name); diff --git a/QuantumBinding.Generator/Processors/NormalizeParametersPass.cs b/QuantumBinding.Generator/Processors/NormalizeParametersPass.cs index 0f24e4a..39e214a 100755 --- a/QuantumBinding.Generator/Processors/NormalizeParametersPass.cs +++ b/QuantumBinding.Generator/Processors/NormalizeParametersPass.cs @@ -89,7 +89,7 @@ public override bool VisitClass(Class @class) var field = new Field("pointer"); field.AccessSpecifier = AccessSpecifier.Public; field.Name = "pointer"; - field.Type = new PointerType() { Pointee = new BuiltinType(PrimitiveType.Void) }; + field.Type = new PointerType() { Pointee = new BuiltinType(PrimitiveType.Nuint) }; @class.NativeStruct.AddField(field); } @@ -178,35 +178,43 @@ public override bool VisitParameter(Parameter parameter) var classDecl = decl as Class; var type = parameter.Type; - switch (type) - { - case ArrayType array when array.IsConst && !array.CanConvertToString(): - parameter.ParameterKind = ParameterKind.Readonly; - break; - case PointerType pointer when pointer.IsConst && !pointer.CanConvertToString(): - parameter.ParameterKind = ParameterKind.Readonly; - break; - case PointerType pointer when !pointer.CanConvertToString() && pointer.Pointee.IsPrimitiveType || classDecl?.IsSimpleType == true || decl is Enumeration: - parameter.ParameterKind = ParameterKind.Ref; - break; - case PointerType pointer when !pointer.Pointee.IsPrimitiveType && !pointer.IsConst && !pointer.IsPointerToStructOrUnion(): + + if (parameter.ParameterKind == ParameterKind.Unknown) + { + switch (type) { - parameter.ParameterKind = ParameterKind.Out; - break; + case ArrayType array when array.IsConst && !array.CanConvertToString(): + parameter.ParameterKind = ParameterKind.Readonly; + break; + case PointerType pointer when pointer.IsConst && !pointer.CanConvertToString(): + parameter.ParameterKind = ParameterKind.Readonly; + break; + case PointerType pointer when !pointer.CanConvertToString() && pointer.Pointee.IsPrimitiveType || + classDecl?.IsSimpleType == true || decl is Enumeration: + parameter.ParameterKind = ParameterKind.Ref; + break; + case PointerType pointer when !pointer.Pointee.IsPrimitiveType && !pointer.IsConst && + !pointer.IsPointerToStructOrUnion(): + { + parameter.ParameterKind = ParameterKind.Out; + break; + } + case PointerType pointer when pointer.GetDepth() >= 3: + { + parameter.ParameterKind = ParameterKind.Out; + break; + } + default: + parameter.ParameterKind = ParameterKind.In; + break; } - case PointerType pointer when pointer.GetDepth() >= 3: + + if (parameter.Name + .StartsWith( + "out")) //small hack to set the correct parameter kind in cases developers calling out parameters starting with outxxx or out_xxx { parameter.ParameterKind = ParameterKind.Out; - break; } - default: - parameter.ParameterKind = ParameterKind.In; - break; - } - - if (parameter.Name.StartsWith("out")) //small hack to set the correct parameter kind in cases developers calling out parameters starting with outxxx or out_xxx - { - parameter.ParameterKind = ParameterKind.Out; } if (CodeGenerator.ReservedWords.Contains(parameter.Name.ToLower())) diff --git a/QuantumBinding.Generator/Processors/PreGeneratorOptions.cs b/QuantumBinding.Generator/Processors/PreGeneratorOptions.cs index a18ca7a..7c6f97f 100755 --- a/QuantumBinding.Generator/Processors/PreGeneratorOptions.cs +++ b/QuantumBinding.Generator/Processors/PreGeneratorOptions.cs @@ -4,6 +4,7 @@ public class PreGeneratorOptions { public bool VisitEnums { get; set; } public bool VisitEnumItems { get; set; } + public bool VisitGlobalUsings { get; set; } public bool VisitClasses { get; set; } public bool VisitFields { get; set; } @@ -15,4 +16,6 @@ public class PreGeneratorOptions public bool VisitParameters { get; set; } public bool VisitMacros { get; set; } + + public bool VisitDispatchTables { get; set; } } \ No newline at end of file diff --git a/QuantumBinding.Generator/Processors/PreGeneratorPass.cs b/QuantumBinding.Generator/Processors/PreGeneratorPass.cs index 9730320..576e7dd 100755 --- a/QuantumBinding.Generator/Processors/PreGeneratorPass.cs +++ b/QuantumBinding.Generator/Processors/PreGeneratorPass.cs @@ -71,7 +71,6 @@ public bool VisitNamespace(Namespace @namespace) ParentDeclaration = null; } - var classes = @namespace.AllClasses.ToArray(); foreach (var @class in classes) { @@ -136,7 +135,6 @@ public bool VisitNamespace(Namespace @namespace) ParentDeclaration = null; } - foreach (var function in @namespace.Functions) { ParentDeclaration = function; @@ -186,6 +184,17 @@ public bool VisitNamespace(Namespace @namespace) ParentDeclaration = null; } + + if (Options.VisitDispatchTables) + { + foreach (var dispatchTable in @namespace.DispatchTables) + { + ParentDeclaration = dispatchTable; + dispatchTable.Visit(this); + } + + ParentDeclaration = null; + } return true; } @@ -195,6 +204,32 @@ public virtual bool VisitMacro(Macro macro) return true; } + public bool VisitGlobalUsings(GlobalUsings globalUsings) + { + if (Options.VisitEnumItems) + { + foreach (var item in globalUsings.Usings) + { + if (IsVisited(item)) + continue; + + VisitGlobalUsingItem(item); + } + } + + return true; + } + + public virtual bool VisitGlobalUsingItem(GlobalUsingItem item) + { + return true; + } + + public virtual bool VisitDispatchTable(DispatchTable dispatchTable) + { + return true; + } + public virtual bool VisitEnum(Enumeration enumeration) { if (Options.VisitEnumItems) diff --git a/QuantumBinding.Generator/Processors/UpdateWrappedMethodParametersPass.cs b/QuantumBinding.Generator/Processors/UpdateWrappedMethodParametersPass.cs index b41b6a0..848d22c 100755 --- a/QuantumBinding.Generator/Processors/UpdateWrappedMethodParametersPass.cs +++ b/QuantumBinding.Generator/Processors/UpdateWrappedMethodParametersPass.cs @@ -3,7 +3,6 @@ using QuantumBinding.Generator.CodeGeneration; using QuantumBinding.Generator.Types; using System.Linq; -using System.Text; namespace QuantumBinding.Generator.Processors; @@ -27,6 +26,20 @@ public override bool VisitMethod(Method method) UpdateReturnType(method); UpdateMethodParameters(method); + + var lastParameter = method.Parameters.LastOrDefault(); + if (lastParameter != null) + { + var decl = lastParameter.Type.Declaration; + + if (lastParameter.IsOptional && + decl is Class { IsWrapper: true } && + !lastParameter.Type.IsPointerToArray() && + lastParameter.ParameterKind is ParameterKind.Readonly or ParameterKind.In) + { + lastParameter.DefaultValue = "null"; + } + } return true; } diff --git a/QuantumBinding.Generator/Processors/WrappersGenerationPass.cs b/QuantumBinding.Generator/Processors/WrappersCodeGenerationPass.cs old mode 100755 new mode 100644 similarity index 89% rename from QuantumBinding.Generator/Processors/WrappersGenerationPass.cs rename to QuantumBinding.Generator/Processors/WrappersCodeGenerationPass.cs index e7e842c..14eadf0 --- a/QuantumBinding.Generator/Processors/WrappersGenerationPass.cs +++ b/QuantumBinding.Generator/Processors/WrappersCodeGenerationPass.cs @@ -1,14 +1,12 @@ using System.Collections.Generic; -using System.Linq; using QuantumBinding.Generator.AST; using QuantumBinding.Generator.CodeGeneration; -using QuantumBinding.Generator.Utils; namespace QuantumBinding.Generator.Processors; -public class WrappersGenerationPass : CodeGeneratorPass +public class WrappersCodeGenerationPass : CodeGeneratorPass { - public WrappersGenerationPass() + public WrappersCodeGenerationPass() { CodeGeneratorPassKind = ExecutionPassKind.PerTranslationUnit; GeneratorSpecializations = GeneratorSpecializations.StructWrappers | GeneratorSpecializations.UnionWrappers; diff --git a/QuantumBinding.Generator/Processors/WrappersCreationPass.cs b/QuantumBinding.Generator/Processors/WrappersCreationPass.cs index 843d058..cb9d9cc 100755 --- a/QuantumBinding.Generator/Processors/WrappersCreationPass.cs +++ b/QuantumBinding.Generator/Processors/WrappersCreationPass.cs @@ -3,7 +3,6 @@ using QuantumBinding.Generator.AST; using QuantumBinding.Generator.CodeGeneration; using QuantumBinding.Generator.Types; -using System.Linq; using System.Text; namespace QuantumBinding.Generator.Processors; @@ -144,7 +143,7 @@ private void CreateStructWrapper(Class @class) pointersCount++; } - if (field.IsPointer && !field.Type.IsPointerToVoid()) + if (field.IsPointer && !field.Type.IsPointerToVoid(out _)) { var pointerType = (PointerType)field.Type; if (field.Name.StartsWith("@")) @@ -246,7 +245,7 @@ private void CreateStructWrapper(Class @class) property.PairedField.AccessSpecifier = AccessSpecifier.Private; if (!property.Type.IsPointerToIntPtr() && - !field.Type.IsPointerToVoid() && + !field.Type.IsPointerToVoid(out _) && !field.Type.IsPointerToSystemType(out var type)) { wrapper.AddField(property.PairedField); @@ -286,7 +285,7 @@ private void CreateStructWrapper(Class @class) wrapper.IsDisposable = true; wrapper.DisposableBaseClass = FileExtensionGenerator.DisposableClassName; - StringBuilder disposeBody = new StringBuilder(); + var disposeBody = new StringBuilder(); var usedFields = new List(); foreach (var field in wrapper.Fields) { diff --git a/QuantumBinding.Generator/QuantumBindingGenerator.cs b/QuantumBinding.Generator/QuantumBindingGenerator.cs index fb65c94..85027e6 100755 --- a/QuantumBinding.Generator/QuantumBindingGenerator.cs +++ b/QuantumBinding.Generator/QuantumBindingGenerator.cs @@ -18,7 +18,7 @@ public void Run() OnSetup(options); if (File.Exists(options.PathToBindingsFile)) { - processingCtx.AddPreGeneratorPass(new LoadBindingsFromFilePass(options.PathToBindingsFile), ExecutionPassKind.PerTranslationUnit); + //processingCtx.AddPreGeneratorPass(new LoadBindingsFromFilePass(options.PathToBindingsFile), ExecutionPassKind.PerTranslationUnit); } OnBeforeSetupPasses(processingCtx); BeforeSetupPassesInternal(processingCtx); @@ -180,7 +180,7 @@ private void AfterSetupPassesInternal(ProcessingContext processingCtx) processingCtx.AddPreGeneratorPass(new GlobalScopeToClassMethod(), ExecutionPassKind.PerTranslationUnit, module); processingCtx.AddPreGeneratorPass(new ContextGenerationAnalyzerPass(), ExecutionPassKind.PerTranslationUnit, module); - processingCtx.AddCodeGenerationPass(new WrappersGenerationPass(), ExecutionPassKind.PerTranslationUnit, module); + processingCtx.AddCodeGenerationPass(new WrappersCodeGenerationPass(), ExecutionPassKind.PerTranslationUnit, module); } } } diff --git a/QuantumBinding.Generator/TypePrinter.cs b/QuantumBinding.Generator/TypePrinter.cs index 82fe699..dca1a37 100755 --- a/QuantumBinding.Generator/TypePrinter.cs +++ b/QuantumBinding.Generator/TypePrinter.cs @@ -120,11 +120,18 @@ public void PopIndent() public abstract TypePrinterResult VisitDelegateType(DelegateType delegateType); public abstract TypePrinterResult VisitDependentNameType(DependentNameType dependentNameType); + public abstract TypePrinterResult VisitDispatchTableType(DispatchTableType dispatchTableType); + + public abstract TypePrinterResult VisitDispatchTable(DispatchTable dispatchTable); public abstract TypePrinterResult VisitEnum(Enumeration enumeration); public abstract TypePrinterResult VisitEnumItem(EnumerationItem item); + public abstract TypePrinterResult VisitGlobalUsings(GlobalUsings globalUsings); + + public abstract TypePrinterResult VisitGlobalUsingItem(GlobalUsingItem item); + public abstract TypePrinterResult VisitFunction(Function function); public abstract TypePrinterResult VisitDelegate(Delegate @delegate); diff --git a/QuantumBinding.Generator/Types/ArrayType.cs b/QuantumBinding.Generator/Types/ArrayType.cs index fce92f9..4017ed0 100755 --- a/QuantumBinding.Generator/Types/ArrayType.cs +++ b/QuantumBinding.Generator/Types/ArrayType.cs @@ -20,6 +20,7 @@ public ArrayType(ArrayType type) : base(type) ArraySizeSource = type.ArraySizeSource; DimensionsCount = type.DimensionsCount; Sizes = type.Sizes; + MathExpression = type.MathExpression; } public BindingType ElementType { get; set; } @@ -37,6 +38,10 @@ public ArrayType(ArrayType type) : base(type) public bool IsConstArray => SizeType == ArraySizeType.Constant; public string ArraySizeSource { get; set; } + + public string MathExpression { get; set; } + + public bool HasMathExpression => !string.IsNullOrEmpty(MathExpression); public List Sizes { get; private set; } @@ -67,7 +72,8 @@ public bool Equals(ArrayType other) ElementSize == other.ElementSize && ArraySizeSource == other.ArraySizeSource && IsConstArray == other.IsConstArray && - DimensionsCount == other.DimensionsCount; + DimensionsCount == other.DimensionsCount && + MathExpression == other.MathExpression; } public override int GetHashCode() diff --git a/QuantumBinding.Generator/Types/BindingType.cs b/QuantumBinding.Generator/Types/BindingType.cs index 23cb080..0a08467 100755 --- a/QuantumBinding.Generator/Types/BindingType.cs +++ b/QuantumBinding.Generator/Types/BindingType.cs @@ -7,6 +7,7 @@ public abstract class BindingType: ICloneable { protected BindingType() { + Qualifiers = new TypeQualifiers(); } protected BindingType(BindingType type) diff --git a/QuantumBinding.Generator/Types/DispatchTableType.cs b/QuantumBinding.Generator/Types/DispatchTableType.cs new file mode 100644 index 0000000..ce31e8f --- /dev/null +++ b/QuantumBinding.Generator/Types/DispatchTableType.cs @@ -0,0 +1,24 @@ +namespace QuantumBinding.Generator.Types; + +public class DispatchTableType : BindingType +{ + public DispatchTableType() + { + + } + + public DispatchTableType(DispatchTableType copy) + { + Declaration = copy.Declaration; + } + + public override T Visit(ITypeVisitor typeVisitor) + { + return typeVisitor.VisitDispatchTableType(this); + } + + public override object Clone() + { + return new DispatchTableType(this); + } +} \ No newline at end of file diff --git a/QuantumBinding.Generator/Types/ITypeVisitor.cs b/QuantumBinding.Generator/Types/ITypeVisitor.cs index 025a342..1f490f4 100755 --- a/QuantumBinding.Generator/Types/ITypeVisitor.cs +++ b/QuantumBinding.Generator/Types/ITypeVisitor.cs @@ -8,5 +8,5 @@ public interface ITypeVisitor T VisitCustomType(CustomType customType); T VisitDelegateType(DelegateType delegateType); T VisitDependentNameType(DependentNameType dependentNameType); - + T VisitDispatchTableType(DispatchTableType dispatchTableType); } \ No newline at end of file diff --git a/QuantumBinding.Generator/Types/PointerType.cs b/QuantumBinding.Generator/Types/PointerType.cs index 1936d4a..9087239 100755 --- a/QuantumBinding.Generator/Types/PointerType.cs +++ b/QuantumBinding.Generator/Types/PointerType.cs @@ -39,6 +39,16 @@ public uint GetDepth() return depth; } + + public BindingType GetBindingType() + { + var pointee = Pointee; + while (pointee is PointerType pointer) + { + pointee = pointer.Pointee; + } + return pointee; + } public BindingType GetPointee() { diff --git a/QuantumBinding.Generator/Types/TypeUtil.cs b/QuantumBinding.Generator/Types/TypeUtil.cs index af8348a..530b54d 100755 --- a/QuantumBinding.Generator/Types/TypeUtil.cs +++ b/QuantumBinding.Generator/Types/TypeUtil.cs @@ -60,12 +60,12 @@ public static bool IsPointerToIntPtr(this BindingType type) public static bool IsPurePointer(this BindingType type) { - return (type.IsPointerToVoid() || type.IsDoublePointer() || type.IsPointerToIntPtr()) && type.Declaration == null; + return (type.IsPointerToVoid(out _) || type.IsDoublePointer() || type.IsPointerToIntPtr()) && type.Declaration == null; } - public static bool IsPointerToVoid(this BindingType type) + public static bool IsPointerToVoid(this BindingType type, out uint depth) { - var depth = 1; + depth = 1; PrimitiveType primitive = PrimitiveType.Unknown; var pointer = type as PointerType; if (pointer == null) return false; @@ -182,7 +182,7 @@ public static bool IsPointerToVoidArray(this BindingType type) var array = type as ArrayType; if (array != null && array.ElementType is PointerType pointerType) { - return pointerType.IsPointerToVoid(); + return pointerType.IsPointerToVoid(out var depth); } return false; @@ -836,7 +836,7 @@ public static bool CanConvertToFixedArray(this BindingType type) public static bool IsAvailableForMarshalContext(this BindingType type) { - return type.IsWrapper() || type.IsArray() || type.IsPointerToArray() || type.IsPointerToString(); + return type.IsWrapper() || type.IsArray() || type.IsPointerToArray() || type.IsPointerToString() || type.IsDoublePointer(); } public static string GetDisplayName(this Enum enumValue) diff --git a/QuantumBinding.Generator/Utils/DeclarationUtils.cs b/QuantumBinding.Generator/Utils/DeclarationUtils.cs index 8bf3aef..6dad47b 100644 --- a/QuantumBinding.Generator/Utils/DeclarationUtils.cs +++ b/QuantumBinding.Generator/Utils/DeclarationUtils.cs @@ -9,6 +9,10 @@ public static GeneratorCategory GetCategory(this Declaration decl) { switch (decl) { + case GlobalUsings: + return GeneratorCategory.GlobalUsings; + case DispatchTable: + return GeneratorCategory.DispatchTables; case Enumeration: return GeneratorCategory.Enums; case Class @class: diff --git a/QuantumBinding.Utils/IMarshallable.cs b/QuantumBinding.Utils/IMarshallable.cs index c5320a7..37762ad 100644 --- a/QuantumBinding.Utils/IMarshallable.cs +++ b/QuantumBinding.Utils/IMarshallable.cs @@ -18,10 +18,10 @@ public interface IUnmanagedWrapper where TNative : unmanaged } #if NET9_0_OR_GREATER -public interface IMarshallableObject +public unsafe interface IMarshallableObject { int GetSize(); - nuint GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct; + void* GetNativePointer(ref TContext context) where TContext : IMarshallingContext, allows ref struct; } #endif diff --git a/QuantumBinding.Utils/MarshalContextUtils.cs b/QuantumBinding.Utils/MarshalContextUtils.cs index 0a8ff38..4cfc94c 100644 --- a/QuantumBinding.Utils/MarshalContextUtils.cs +++ b/QuantumBinding.Utils/MarshalContextUtils.cs @@ -75,7 +75,7 @@ public static TNative MarshalStructToNative( return (TBlittable*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(destinationByteSpan)); } - public static TBlittable[] UnmarshalBlittableArray(TBlittable* source, int count) + public static TBlittable[] UnmarshalBlittableArray(TBlittable* source, long count) where TBlittable : unmanaged { if (source == null || count <= 0) @@ -389,4 +389,26 @@ public static int CalculateRequiredSizeForStringArray(ReadOnlySpan sourc return pointerArraySize + stringsDataSize; } + + /// + /// For future use in case if we will need memory alignment + /// + /// + /// + public static void AlignCursor(ref Span cursor, int alignment = 8) + { + fixed (byte* ptr = cursor) + { + var address = (nuint)ptr; + var remainder = address % (nuint)alignment; + if (remainder != 0) + { + var padding = (int)((nuint)alignment - remainder); + if (padding < cursor.Length) + { + cursor = cursor.Slice(padding); + } + } + } + } } \ No newline at end of file From 090f914fcfa0f350fb70064b119e37457c2a4376 Mon Sep 17 00:00:00 2001 From: "denis.zaporozhets" Date: Sun, 17 May 2026 22:47:27 +0300 Subject: [PATCH 2/3] improvements to code generation based on updated logic --- .../Generated/Classes/QBClientData.cs | 16 +- .../Generated/Classes/QBCompletionString.cs | 16 +- .../Generated/Classes/QBDiagnostic.cs | 16 +- .../Generated/Classes/QBDiagnosticSet.cs | 16 +- .../Generated/Classes/QBEvalResult.cs | 16 +- .../Generated/Classes/QBFile.cs | 22 +- .../Generated/Classes/QBIdxClientASTFile.cs | 16 +- .../Generated/Classes/QBIdxClientContainer.cs | 16 +- .../Generated/Classes/QBIdxClientEntity.cs | 16 +- .../Generated/Classes/QBIdxClientFile.cs | 16 +- .../Generated/Classes/QBIndex.cs | 28 +-- .../Generated/Classes/QBIndexAction.cs | 30 +-- .../Generated/Classes/QBModule.cs | 16 +- .../Classes/QBModuleMapDescriptor.cs | 7 +- .../Generated/Classes/QBPrintingPolicy.cs | 16 +- .../Generated/Classes/QBRemapping.cs | 16 +- .../Generated/Classes/QBTranslationUnit.cs | 26 +- .../Generated/Classes/QBVirtualFileOverlay.cs | 7 +- .../Interop/Delegates/CXCursorVisitor.cs | 14 +- .../Interop/Delegates/CXFieldVisitor.cs | 14 +- .../Interop/Delegates/CXInclusionVisitor.cs | 14 +- .../QuantumBinding.Clang.Functions.cs | 230 +++++++++--------- .../OldFashionDelegates.cs | 6 +- .../Generated/Interop/Structs/CXAPISetImpl.cs | 2 +- .../Generated/Interop/Structs/CXClientData.cs | 24 ++ .../Generated/Interop/Structs/CXComment.cs | 2 +- .../Interop/Structs/CXCompletionResult.cs | 2 +- .../Interop/Structs/CXCompletionString.cs | 24 ++ .../Structs/CXCursorAndRangeVisitor.cs | 5 +- .../Interop/Structs/CXCursorSetImpl.cs | 2 +- .../Generated/Interop/Structs/CXDiagnostic.cs | 24 ++ ...CXClientDataImpl.cs => CXDiagnosticSet.cs} | 7 +- ...ompletionStringImpl.cs => CXEvalResult.cs} | 7 +- .../Interop/Structs/CXEvalResultImpl.cs | 21 -- .../{CXDiagnosticImpl.cs => CXFile.cs} | 7 +- .../Generated/Interop/Structs/CXFileImpl.cs | 21 -- .../Interop/Structs/CXIdxClientASTFile.cs | 24 ++ .../Interop/Structs/CXIdxClientASTFileImpl.cs | 21 -- .../Interop/Structs/CXIdxClientContainer.cs | 24 ++ .../Structs/CXIdxClientContainerImpl.cs | 21 -- .../Interop/Structs/CXIdxClientEntity.cs | 24 ++ .../Interop/Structs/CXIdxClientEntityImpl.cs | 21 -- ...iagnosticSetImpl.cs => CXIdxClientFile.cs} | 7 +- .../Interop/Structs/CXIdxClientFileImpl.cs | 21 -- .../Structs/CXIdxImportedASTFileInfo.cs | 5 +- .../Interop/Structs/CXIdxIncludedFileInfo.cs | 3 +- .../Generated/Interop/Structs/CXIndex.cs | 24 ++ .../Interop/Structs/CXIndexAction.cs | 24 ++ .../Interop/Structs/CXIndexActionImpl.cs | 21 -- .../Generated/Interop/Structs/CXIndexImpl.cs | 21 -- .../Generated/Interop/Structs/CXModule.cs | 24 ++ .../Generated/Interop/Structs/CXModuleImpl.cs | 21 -- .../Structs/CXModuleMapDescriptorImpl.cs | 2 +- .../Interop/Structs/CXPrintingPolicy.cs | 24 ++ .../Interop/Structs/CXPrintingPolicyImpl.cs | 21 -- .../Generated/Interop/Structs/CXRemapping.cs | 24 ++ .../Interop/Structs/CXRemappingImpl.cs | 21 -- .../Generated/Interop/Structs/CXString.cs | 2 +- .../Interop/Structs/CXTUResourceUsage.cs | 2 +- .../Interop/Structs/CXTargetInfoImpl.cs | 2 +- .../Generated/Interop/Structs/CXToken.cs | 2 +- .../Interop/Structs/CXTranslationUnitImpl.cs | 2 +- .../Structs/CXVirtualFileOverlayImpl.cs | 2 +- .../Interop/Structs/IndexerCallbacks.cs | 17 +- .../Interop/Structs/_CXChildVisitResult.cs | 2 +- .../Structs/_CXCursorAndRangeVisitorBlock.cs | 2 +- .../QuantumBinding.Clang.StaticMethods.cs | 24 +- .../StructWrappers/IndexerCallbacks.cs | 19 +- .../StructWrappers/QBCodeCompleteResults.cs | 3 + .../Generated/StructWrappers/QBComment.cs | 10 +- .../StructWrappers/QBCompletionResult.cs | 8 +- .../Generated/StructWrappers/QBCursor.cs | 39 +-- .../StructWrappers/QBCursorAndRangeVisitor.cs | 14 +- .../StructWrappers/QBFileUniqueID.cs | 6 +- .../StructWrappers/QBIdxCXXClassDeclInfo.cs | 7 +- .../Generated/StructWrappers/QBIdxDeclInfo.cs | 7 +- .../StructWrappers/QBIdxEntityInfo.cs | 7 +- .../StructWrappers/QBIdxEntityRefInfo.cs | 3 + .../QBIdxImportedASTFileInfo.cs | 13 +- .../StructWrappers/QBIdxIncludedFileInfo.cs | 8 +- .../Generated/StructWrappers/QBIdxLoc.cs | 9 +- .../QBIdxObjCProtocolRefListInfo.cs | 7 +- .../StructWrappers/QBIndexOptions.cs | 3 + .../StructWrappers/QBPlatformAvailability.cs | 3 + .../StructWrappers/QBSourceLocation.cs | 23 +- .../Generated/StructWrappers/QBSourceRange.cs | 3 + .../StructWrappers/QBSourceRangeList.cs | 3 + .../Generated/StructWrappers/QBString.cs | 10 +- .../StructWrappers/QBTUResourceUsage.cs | 10 +- .../Generated/StructWrappers/QBToken.cs | 13 +- .../Generated/StructWrappers/QBType.cs | 13 +- .../Generated/StructWrappers/QBUnsavedFile.cs | 3 + .../Generated/StructWrappers/QBVersion.cs | 3 + QuantumBinding.Demo/ClangBindingGenerator.cs | 38 +-- .../AST/DeclarationUnit.cs | 7 - QuantumBinding.Generator/AST/Function.cs | 4 - QuantumBinding.Generator/AST/Parameter.cs | 23 +- QuantumBinding.Generator/CSharpTypePrinter.cs | 83 +++++-- .../MarshalContextToFunctionCodeGenerator.cs | 44 +++- .../MethodToFunctionCodeGenerator.cs | 8 +- .../MethodToRefStructCodeGenerator.cs | 10 +- .../CodeGeneration/WrapperGenerator.cs | 2 + .../Parser/Clang/ClangParser.cs | 1 - .../FunctionToInstanceMethodPass.cs | 42 ++-- .../Processors/NormalizeParametersPass.cs | 2 +- QuantumBinding.Generator/Types/TypeUtil.cs | 6 +- QuantumBinding.Generator/Utils/ClangUtils.cs | 27 +- 107 files changed, 961 insertions(+), 776 deletions(-) create mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXClientData.cs create mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCompletionString.cs create mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXDiagnostic.cs rename QuantumBinding.ClangPlayground/Generated/Interop/Structs/{CXClientDataImpl.cs => CXDiagnosticSet.cs} (81%) rename QuantumBinding.ClangPlayground/Generated/Interop/Structs/{CXCompletionStringImpl.cs => CXEvalResult.cs} (81%) delete mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXEvalResultImpl.cs rename QuantumBinding.ClangPlayground/Generated/Interop/Structs/{CXDiagnosticImpl.cs => CXFile.cs} (78%) delete mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXFileImpl.cs create mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientASTFile.cs delete mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientASTFileImpl.cs create mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientContainer.cs delete mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientContainerImpl.cs create mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientEntity.cs delete mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientEntityImpl.cs rename QuantumBinding.ClangPlayground/Generated/Interop/Structs/{CXDiagnosticSetImpl.cs => CXIdxClientFile.cs} (78%) delete mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientFileImpl.cs create mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIndex.cs create mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIndexAction.cs delete mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIndexActionImpl.cs delete mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIndexImpl.cs create mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXModule.cs delete mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXModuleImpl.cs create mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXPrintingPolicy.cs delete mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXPrintingPolicyImpl.cs create mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXRemapping.cs delete mode 100644 QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXRemappingImpl.cs diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBClientData.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBClientData.cs index d77f198..aad9d5f 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBClientData.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBClientData.cs @@ -16,27 +16,27 @@ namespace QuantumBinding.Clang; /// /// Opaque pointer representing client data that will be passed through to various callbacks and visitors. /// -public unsafe partial class QBClientData : IUnmanagedWrapper +public unsafe partial class QBClientData : IUnmanagedWrapper { - internal CXClientDataImpl __Instance; + internal CXClientData __Instance; public QBClientData() { } - public QBClientData(in QuantumBinding.Clang.Interop.CXClientDataImpl __Instance) + public QBClientData(in QuantumBinding.Clang.Interop.CXClientData __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXClientDataImpl GetNativeValue() => __Instance; - public ref readonly CXClientDataImpl GetPinnableReference() => ref __Instance; + public QuantumBinding.Clang.Interop.CXClientData GetNativeValue() => __Instance; + public ref readonly CXClientData GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXClientDataImpl(QBClientData q) + public static implicit operator QuantumBinding.Clang.Interop.CXClientData(QBClientData q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXClientDataImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXClientData(); } - public static implicit operator QBClientData(QuantumBinding.Clang.Interop.CXClientDataImpl q) + public static implicit operator QBClientData(QuantumBinding.Clang.Interop.CXClientData q) { return new QBClientData(in q); } diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBCompletionString.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBCompletionString.cs index e1737f1..3dc4f6c 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBCompletionString.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBCompletionString.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// A semantic string that describes a code-completion result. /// -public unsafe partial class QBCompletionString : IUnmanagedWrapper +public unsafe partial class QBCompletionString : IUnmanagedWrapper { - internal CXCompletionStringImpl __Instance; + internal CXCompletionString __Instance; public QBCompletionString() { } - public QBCompletionString(in QuantumBinding.Clang.Interop.CXCompletionStringImpl __Instance) + public QBCompletionString(in QuantumBinding.Clang.Interop.CXCompletionString __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXCompletionStringImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXCompletionString GetNativeValue() => __Instance; /// /// Retrieve the annotation associated with the given completion string. /// @@ -116,14 +116,14 @@ public uint GetNumCompletionChunks() return QuantumBinding.Clang.Interop.ClangInterop.clang_getNumCompletionChunks(this); } - public ref readonly CXCompletionStringImpl GetPinnableReference() => ref __Instance; + public ref readonly CXCompletionString GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXCompletionStringImpl(QBCompletionString q) + public static implicit operator QuantumBinding.Clang.Interop.CXCompletionString(QBCompletionString q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXCompletionStringImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXCompletionString(); } - public static implicit operator QBCompletionString(QuantumBinding.Clang.Interop.CXCompletionStringImpl q) + public static implicit operator QBCompletionString(QuantumBinding.Clang.Interop.CXCompletionString q) { return new QBCompletionString(in q); } diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBDiagnostic.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBDiagnostic.cs index f7b5c88..d8652ef 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBDiagnostic.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBDiagnostic.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// A single diagnostic, containing the diagnostic's severity, location, text, source ranges, and fix-it hints. /// -public unsafe partial class QBDiagnostic : IUnmanagedWrapper +public unsafe partial class QBDiagnostic : IUnmanagedWrapper { - internal CXDiagnosticImpl __Instance; + internal CXDiagnostic __Instance; public QBDiagnostic() { } - public QBDiagnostic(in QuantumBinding.Clang.Interop.CXDiagnosticImpl __Instance) + public QBDiagnostic(in QuantumBinding.Clang.Interop.CXDiagnostic __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXDiagnosticImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXDiagnostic GetNativeValue() => __Instance; /// /// Destroy a diagnostic. /// @@ -175,14 +175,14 @@ public QBString GetDiagnosticSpelling() return QuantumBinding.Clang.Interop.ClangInterop.clang_getDiagnosticSpelling(this); } - public ref readonly CXDiagnosticImpl GetPinnableReference() => ref __Instance; + public ref readonly CXDiagnostic GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXDiagnosticImpl(QBDiagnostic q) + public static implicit operator QuantumBinding.Clang.Interop.CXDiagnostic(QBDiagnostic q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXDiagnosticImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXDiagnostic(); } - public static implicit operator QBDiagnostic(QuantumBinding.Clang.Interop.CXDiagnosticImpl q) + public static implicit operator QBDiagnostic(QuantumBinding.Clang.Interop.CXDiagnostic q) { return new QBDiagnostic(in q); } diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBDiagnosticSet.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBDiagnosticSet.cs index 00ad65e..8979e6b 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBDiagnosticSet.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBDiagnosticSet.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// A group of CXDiagnostics. /// -public unsafe partial class QBDiagnosticSet : IUnmanagedWrapper +public unsafe partial class QBDiagnosticSet : IUnmanagedWrapper { - internal CXDiagnosticSetImpl __Instance; + internal CXDiagnosticSet __Instance; public QBDiagnosticSet() { } - public QBDiagnosticSet(in QuantumBinding.Clang.Interop.CXDiagnosticSetImpl __Instance) + public QBDiagnosticSet(in QuantumBinding.Clang.Interop.CXDiagnosticSet __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXDiagnosticSetImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXDiagnosticSet GetNativeValue() => __Instance; /// /// Release a CXDiagnosticSet and all of its contained diagnostics. /// @@ -53,14 +53,14 @@ public uint GetNumDiagnosticsInSet() return QuantumBinding.Clang.Interop.ClangInterop.clang_getNumDiagnosticsInSet(this); } - public ref readonly CXDiagnosticSetImpl GetPinnableReference() => ref __Instance; + public ref readonly CXDiagnosticSet GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXDiagnosticSetImpl(QBDiagnosticSet q) + public static implicit operator QuantumBinding.Clang.Interop.CXDiagnosticSet(QBDiagnosticSet q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXDiagnosticSetImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXDiagnosticSet(); } - public static implicit operator QBDiagnosticSet(QuantumBinding.Clang.Interop.CXDiagnosticSetImpl q) + public static implicit operator QBDiagnosticSet(QuantumBinding.Clang.Interop.CXDiagnosticSet q) { return new QBDiagnosticSet(in q); } diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBEvalResult.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBEvalResult.cs index 678465b..830f55d 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBEvalResult.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBEvalResult.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// Evaluation result of a cursor /// -public unsafe partial class QBEvalResult : IUnmanagedWrapper +public unsafe partial class QBEvalResult : IUnmanagedWrapper { - internal CXEvalResultImpl __Instance; + internal CXEvalResult __Instance; public QBEvalResult() { } - public QBEvalResult(in QuantumBinding.Clang.Interop.CXEvalResultImpl __Instance) + public QBEvalResult(in QuantumBinding.Clang.Interop.CXEvalResult __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXEvalResultImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXEvalResult GetNativeValue() => __Instance; /// /// Disposes the created Eval memory. /// @@ -94,14 +94,14 @@ public uint EvalResult_isUnsignedInt() return QuantumBinding.Clang.Interop.ClangInterop.clang_EvalResult_isUnsignedInt(this); } - public ref readonly CXEvalResultImpl GetPinnableReference() => ref __Instance; + public ref readonly CXEvalResult GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXEvalResultImpl(QBEvalResult q) + public static implicit operator QuantumBinding.Clang.Interop.CXEvalResult(QBEvalResult q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXEvalResultImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXEvalResult(); } - public static implicit operator QBEvalResult(QuantumBinding.Clang.Interop.CXEvalResultImpl q) + public static implicit operator QBEvalResult(QuantumBinding.Clang.Interop.CXEvalResult q) { return new QBEvalResult(in q); } diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBFile.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBFile.cs index a8d895f..c4b58a9 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBFile.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBFile.cs @@ -16,25 +16,25 @@ namespace QuantumBinding.Clang; /// /// A particular source file that is part of a translation unit. /// -public unsafe partial class QBFile : IUnmanagedWrapper +public unsafe partial class QBFile : IUnmanagedWrapper { - internal CXFileImpl __Instance; + internal CXFile __Instance; public QBFile() { } - public QBFile(in QuantumBinding.Clang.Interop.CXFileImpl __Instance) + public QBFile(in QuantumBinding.Clang.Interop.CXFile __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXFileImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXFile GetNativeValue() => __Instance; /// /// Returns non-zero if the file1 and file2 point to the same file, or they are both NULL. /// public int File_isEqual(QuantumBinding.Clang.QBFile file2) { - var arg1 = file2 == null ? new CXFileImpl() : (CXFileImpl)file2; + var arg1 = file2 == null ? new CXFile() : (CXFile)file2; return QuantumBinding.Clang.Interop.ClangInterop.clang_File_isEqual(this, arg1); } @@ -67,20 +67,20 @@ public long GetFileTime() /// public int GetFileUniqueID(out QBFileUniqueID outID) { - QuantumBinding.Clang.Interop.CXFileUniqueID arg1; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_getFileUniqueID(this, out arg1); + QuantumBinding.Clang.Interop.CXFileUniqueID arg1 = default; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_getFileUniqueID(this, &arg1); outID = new QBFileUniqueID(arg1); return result; } - public ref readonly CXFileImpl GetPinnableReference() => ref __Instance; + public ref readonly CXFile GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXFileImpl(QBFile q) + public static implicit operator QuantumBinding.Clang.Interop.CXFile(QBFile q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXFileImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXFile(); } - public static implicit operator QBFile(QuantumBinding.Clang.Interop.CXFileImpl q) + public static implicit operator QBFile(QuantumBinding.Clang.Interop.CXFile q) { return new QBFile(in q); } diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBIdxClientASTFile.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBIdxClientASTFile.cs index 23b5aa2..c44a326 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBIdxClientASTFile.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBIdxClientASTFile.cs @@ -16,27 +16,27 @@ namespace QuantumBinding.Clang; /// /// The client's data object that is associated with an AST file (PCH or module). /// -public unsafe partial class QBIdxClientASTFile : IUnmanagedWrapper +public unsafe partial class QBIdxClientASTFile : IUnmanagedWrapper { - internal CXIdxClientASTFileImpl __Instance; + internal CXIdxClientASTFile __Instance; public QBIdxClientASTFile() { } - public QBIdxClientASTFile(in QuantumBinding.Clang.Interop.CXIdxClientASTFileImpl __Instance) + public QBIdxClientASTFile(in QuantumBinding.Clang.Interop.CXIdxClientASTFile __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXIdxClientASTFileImpl GetNativeValue() => __Instance; - public ref readonly CXIdxClientASTFileImpl GetPinnableReference() => ref __Instance; + public QuantumBinding.Clang.Interop.CXIdxClientASTFile GetNativeValue() => __Instance; + public ref readonly CXIdxClientASTFile GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXIdxClientASTFileImpl(QBIdxClientASTFile q) + public static implicit operator QuantumBinding.Clang.Interop.CXIdxClientASTFile(QBIdxClientASTFile q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIdxClientASTFileImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIdxClientASTFile(); } - public static implicit operator QBIdxClientASTFile(QuantumBinding.Clang.Interop.CXIdxClientASTFileImpl q) + public static implicit operator QBIdxClientASTFile(QuantumBinding.Clang.Interop.CXIdxClientASTFile q) { return new QBIdxClientASTFile(in q); } diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBIdxClientContainer.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBIdxClientContainer.cs index 8b8e93e..a98bf18 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBIdxClientContainer.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBIdxClientContainer.cs @@ -16,27 +16,27 @@ namespace QuantumBinding.Clang; /// /// The client's data object that is associated with a semantic container of entities. /// -public unsafe partial class QBIdxClientContainer : IUnmanagedWrapper +public unsafe partial class QBIdxClientContainer : IUnmanagedWrapper { - internal CXIdxClientContainerImpl __Instance; + internal CXIdxClientContainer __Instance; public QBIdxClientContainer() { } - public QBIdxClientContainer(in QuantumBinding.Clang.Interop.CXIdxClientContainerImpl __Instance) + public QBIdxClientContainer(in QuantumBinding.Clang.Interop.CXIdxClientContainer __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXIdxClientContainerImpl GetNativeValue() => __Instance; - public ref readonly CXIdxClientContainerImpl GetPinnableReference() => ref __Instance; + public QuantumBinding.Clang.Interop.CXIdxClientContainer GetNativeValue() => __Instance; + public ref readonly CXIdxClientContainer GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXIdxClientContainerImpl(QBIdxClientContainer q) + public static implicit operator QuantumBinding.Clang.Interop.CXIdxClientContainer(QBIdxClientContainer q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIdxClientContainerImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIdxClientContainer(); } - public static implicit operator QBIdxClientContainer(QuantumBinding.Clang.Interop.CXIdxClientContainerImpl q) + public static implicit operator QBIdxClientContainer(QuantumBinding.Clang.Interop.CXIdxClientContainer q) { return new QBIdxClientContainer(in q); } diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBIdxClientEntity.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBIdxClientEntity.cs index 7cef11c..b58c56e 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBIdxClientEntity.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBIdxClientEntity.cs @@ -16,27 +16,27 @@ namespace QuantumBinding.Clang; /// /// The client's data object that is associated with a semantic entity. /// -public unsafe partial class QBIdxClientEntity : IUnmanagedWrapper +public unsafe partial class QBIdxClientEntity : IUnmanagedWrapper { - internal CXIdxClientEntityImpl __Instance; + internal CXIdxClientEntity __Instance; public QBIdxClientEntity() { } - public QBIdxClientEntity(in QuantumBinding.Clang.Interop.CXIdxClientEntityImpl __Instance) + public QBIdxClientEntity(in QuantumBinding.Clang.Interop.CXIdxClientEntity __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXIdxClientEntityImpl GetNativeValue() => __Instance; - public ref readonly CXIdxClientEntityImpl GetPinnableReference() => ref __Instance; + public QuantumBinding.Clang.Interop.CXIdxClientEntity GetNativeValue() => __Instance; + public ref readonly CXIdxClientEntity GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXIdxClientEntityImpl(QBIdxClientEntity q) + public static implicit operator QuantumBinding.Clang.Interop.CXIdxClientEntity(QBIdxClientEntity q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIdxClientEntityImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIdxClientEntity(); } - public static implicit operator QBIdxClientEntity(QuantumBinding.Clang.Interop.CXIdxClientEntityImpl q) + public static implicit operator QBIdxClientEntity(QuantumBinding.Clang.Interop.CXIdxClientEntity q) { return new QBIdxClientEntity(in q); } diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBIdxClientFile.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBIdxClientFile.cs index e3200f4..9c4550b 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBIdxClientFile.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBIdxClientFile.cs @@ -16,27 +16,27 @@ namespace QuantumBinding.Clang; /// /// The client's data object that is associated with a CXFile. /// -public unsafe partial class QBIdxClientFile : IUnmanagedWrapper +public unsafe partial class QBIdxClientFile : IUnmanagedWrapper { - internal CXIdxClientFileImpl __Instance; + internal CXIdxClientFile __Instance; public QBIdxClientFile() { } - public QBIdxClientFile(in QuantumBinding.Clang.Interop.CXIdxClientFileImpl __Instance) + public QBIdxClientFile(in QuantumBinding.Clang.Interop.CXIdxClientFile __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXIdxClientFileImpl GetNativeValue() => __Instance; - public ref readonly CXIdxClientFileImpl GetPinnableReference() => ref __Instance; + public QuantumBinding.Clang.Interop.CXIdxClientFile GetNativeValue() => __Instance; + public ref readonly CXIdxClientFile GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXIdxClientFileImpl(QBIdxClientFile q) + public static implicit operator QuantumBinding.Clang.Interop.CXIdxClientFile(QBIdxClientFile q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIdxClientFileImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIdxClientFile(); } - public static implicit operator QBIdxClientFile(QuantumBinding.Clang.Interop.CXIdxClientFileImpl q) + public static implicit operator QBIdxClientFile(QuantumBinding.Clang.Interop.CXIdxClientFile q) { return new QBIdxClientFile(in q); } diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBIndex.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBIndex.cs index dc775c2..962c062 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBIndex.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBIndex.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// An "index" that consists of a set of translation units that would typically be linked together into an executable or library. /// -public unsafe partial class QBIndex : IUnmanagedWrapper +public unsafe partial class QBIndex : IUnmanagedWrapper { - internal CXIndexImpl __Instance; + internal CXIndex __Instance; public QBIndex() { } - public QBIndex(in QuantumBinding.Clang.Interop.CXIndexImpl __Instance) + public QBIndex(in QuantumBinding.Clang.Interop.CXIndex __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXIndexImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXIndex GetNativeValue() => __Instance; /// /// Same as clang_createTranslationUnit2, but returns the CXTranslationUnit instead of an error code. In case of an error this routine returns a NULL CXTranslationUnit, without further detailed error codes. /// @@ -78,8 +78,8 @@ int CalculateSize(string ast_filename) { ref System.Span currentCursor = ref mainBuffer; var arg1 = QuantumBinding.Utils.MarshalContextUtils.MarshalString(ast_filename, ref currentCursor); - CXTranslationUnitImpl arg2; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_createTranslationUnit2(this, arg1, out arg2); + CXTranslationUnitImpl arg2 = default; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_createTranslationUnit2(this, arg1, &arg2); out_TU = new QBTranslationUnit(arg2); return result; } @@ -253,8 +253,8 @@ int CalculateSize(string source_filename, System.ReadOnlySpan command_li { arg4 = QuantumBinding.Utils.MarshalContextUtils.MarshalArrayOfWrappers(unsaved_files, ref currentCursor); } - CXTranslationUnitImpl arg7; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_parseTranslationUnit2(this, arg1, arg2, num_command_line_args, arg4, num_unsaved_files, options, out arg7); + CXTranslationUnitImpl arg7 = default; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_parseTranslationUnit2(this, arg1, arg2, num_command_line_args, arg4, num_unsaved_files, options, &arg7); out_TU = new QBTranslationUnit(arg7); return result; } @@ -290,8 +290,8 @@ int CalculateSize(string source_filename, System.ReadOnlySpan command_li var arg1 = QuantumBinding.Utils.MarshalContextUtils.MarshalString(source_filename, ref currentCursor); var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStringArray(command_line_args, ref currentCursor); var arg4 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(unsaved_files, ref currentCursor); - CXTranslationUnitImpl arg7; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_parseTranslationUnit2FullArgv(this, arg1, arg2, num_command_line_args, arg4, num_unsaved_files, options, out arg7); + CXTranslationUnitImpl arg7 = default; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_parseTranslationUnit2FullArgv(this, arg1, arg2, num_command_line_args, arg4, num_unsaved_files, options, &arg7); out_TU = new QBTranslationUnit(arg7); return result; } @@ -302,14 +302,14 @@ int CalculateSize(string source_filename, System.ReadOnlySpan command_li } } - public ref readonly CXIndexImpl GetPinnableReference() => ref __Instance; + public ref readonly CXIndex GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXIndexImpl(QBIndex q) + public static implicit operator QuantumBinding.Clang.Interop.CXIndex(QBIndex q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIndexImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIndex(); } - public static implicit operator QBIndex(QuantumBinding.Clang.Interop.CXIndexImpl q) + public static implicit operator QBIndex(QuantumBinding.Clang.Interop.CXIndex q) { return new QBIndex(in q); } diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBIndexAction.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBIndexAction.cs index 464ad2d..6cc51f7 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBIndexAction.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBIndexAction.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// An indexing action/session, to be applied to one or multiple translation units. /// -public unsafe partial class QBIndexAction : IUnmanagedWrapper +public unsafe partial class QBIndexAction : IUnmanagedWrapper { - internal CXIndexActionImpl __Instance; + internal CXIndexAction __Instance; public QBIndexAction() { } - public QBIndexAction(in QuantumBinding.Clang.Interop.CXIndexActionImpl __Instance) + public QBIndexAction(in QuantumBinding.Clang.Interop.CXIndexAction __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXIndexActionImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXIndexAction GetNativeValue() => __Instance; /// /// Destroy the given index action. /// @@ -61,13 +61,13 @@ int CalculateSize(IndexerCallbacks index_callbacks, string source_filename, Syst try { ref System.Span currentCursor = ref mainBuffer; - var arg1 = client_data == null ? new CXClientDataImpl() : (CXClientDataImpl)client_data; + var arg1 = client_data == null ? new CXClientData() : (CXClientData)client_data; var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(index_callbacks, ref currentCursor); var arg5 = QuantumBinding.Utils.MarshalContextUtils.MarshalString(source_filename, ref currentCursor); var arg6 = QuantumBinding.Utils.MarshalContextUtils.MarshalStringArray(command_line_args, ref currentCursor); var arg8 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(unsaved_files, ref currentCursor); - CXTranslationUnitImpl arg10; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_indexSourceFile(this, arg1, arg2, index_callbacks_size, index_options, arg5, arg6, num_command_line_args, arg8, num_unsaved_files, out arg10, tU_options); + CXTranslationUnitImpl arg10 = default; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_indexSourceFile(this, arg1, arg2, index_callbacks_size, index_options, arg5, arg6, num_command_line_args, arg8, num_unsaved_files, &arg10, tU_options); out_TU = new QBTranslationUnit(arg10); return result; } @@ -102,13 +102,13 @@ int CalculateSize(IndexerCallbacks index_callbacks, string source_filename, Syst try { ref System.Span currentCursor = ref mainBuffer; - var arg1 = client_data == null ? new CXClientDataImpl() : (CXClientDataImpl)client_data; + var arg1 = client_data == null ? new CXClientData() : (CXClientData)client_data; var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(index_callbacks, ref currentCursor); var arg5 = QuantumBinding.Utils.MarshalContextUtils.MarshalString(source_filename, ref currentCursor); var arg6 = QuantumBinding.Utils.MarshalContextUtils.MarshalStringArray(command_line_args, ref currentCursor); var arg8 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(unsaved_files, ref currentCursor); - CXTranslationUnitImpl arg10; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_indexSourceFileFullArgv(this, arg1, arg2, index_callbacks_size, index_options, arg5, arg6, num_command_line_args, arg8, num_unsaved_files, out arg10, tU_options); + CXTranslationUnitImpl arg10 = default; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_indexSourceFileFullArgv(this, arg1, arg2, index_callbacks_size, index_options, arg5, arg6, num_command_line_args, arg8, num_unsaved_files, &arg10, tU_options); out_TU = new QBTranslationUnit(arg10); return result; } @@ -138,7 +138,7 @@ int CalculateSize(IndexerCallbacks index_callbacks) try { ref System.Span currentCursor = ref mainBuffer; - var arg1 = client_data == null ? new CXClientDataImpl() : (CXClientDataImpl)client_data; + var arg1 = client_data == null ? new CXClientData() : (CXClientData)client_data; var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(index_callbacks, ref currentCursor); var arg5 = param5 == null ? new CXTranslationUnitImpl() : (CXTranslationUnitImpl)param5; return QuantumBinding.Clang.Interop.ClangInterop.clang_indexTranslationUnit(this, arg1, arg2, index_callbacks_size, index_options, arg5); @@ -150,14 +150,14 @@ int CalculateSize(IndexerCallbacks index_callbacks) } } - public ref readonly CXIndexActionImpl GetPinnableReference() => ref __Instance; + public ref readonly CXIndexAction GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXIndexActionImpl(QBIndexAction q) + public static implicit operator QuantumBinding.Clang.Interop.CXIndexAction(QBIndexAction q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIndexActionImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIndexAction(); } - public static implicit operator QBIndexAction(QuantumBinding.Clang.Interop.CXIndexActionImpl q) + public static implicit operator QBIndexAction(QuantumBinding.Clang.Interop.CXIndexAction q) { return new QBIndexAction(in q); } diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBModule.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBModule.cs index f3f8092..d1bf9ec 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBModule.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBModule.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// The functions in this group provide access to information about modules. /// -public unsafe partial class QBModule : IUnmanagedWrapper +public unsafe partial class QBModule : IUnmanagedWrapper { - internal CXModuleImpl __Instance; + internal CXModule __Instance; public QBModule() { } - public QBModule(in QuantumBinding.Clang.Interop.CXModuleImpl __Instance) + public QBModule(in QuantumBinding.Clang.Interop.CXModule __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXModuleImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXModule GetNativeValue() => __Instance; /// /// Returns the module file where the provided module object came from. /// @@ -69,14 +69,14 @@ public int Module_isSystem() return QuantumBinding.Clang.Interop.ClangInterop.clang_Module_isSystem(this); } - public ref readonly CXModuleImpl GetPinnableReference() => ref __Instance; + public ref readonly CXModule GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXModuleImpl(QBModule q) + public static implicit operator QuantumBinding.Clang.Interop.CXModule(QBModule q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXModuleImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXModule(); } - public static implicit operator QBModule(QuantumBinding.Clang.Interop.CXModuleImpl q) + public static implicit operator QBModule(QuantumBinding.Clang.Interop.CXModule q) { return new QBModule(in q); } diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBModuleMapDescriptor.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBModuleMapDescriptor.cs index 6d73708..879ffda 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBModuleMapDescriptor.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBModuleMapDescriptor.cs @@ -98,9 +98,12 @@ int CalculateSize(string name) /// /// Write out the CXModuleMapDescriptor object to a char buffer. /// - public CXErrorCode ModuleMapDescriptor_writeToBuffer(uint options, out sbyte* out_buffer_ptr, out uint out_buffer_size) + public CXErrorCode ModuleMapDescriptor_writeToBuffer(uint options, out nuint out_buffer_ptr, out uint out_buffer_size) { - return QuantumBinding.Clang.Interop.ClangInterop.clang_ModuleMapDescriptor_writeToBuffer(this, options, out out_buffer_ptr, out out_buffer_size); + sbyte* arg2 = null; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_ModuleMapDescriptor_writeToBuffer(this, options, out arg2, out out_buffer_size); + out_buffer_ptr = (nuint)arg2; + return result; } public ref readonly CXModuleMapDescriptorImpl GetPinnableReference() => ref __Instance; diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBPrintingPolicy.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBPrintingPolicy.cs index d9d9e0d..88f987a 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBPrintingPolicy.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBPrintingPolicy.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// Opaque pointer representing a policy that controls pretty printing for clang_getCursorPrettyPrinted. /// -public unsafe partial class QBPrintingPolicy : IUnmanagedWrapper +public unsafe partial class QBPrintingPolicy : IUnmanagedWrapper { - internal CXPrintingPolicyImpl __Instance; + internal CXPrintingPolicy __Instance; public QBPrintingPolicy() { } - public QBPrintingPolicy(in QuantumBinding.Clang.Interop.CXPrintingPolicyImpl __Instance) + public QBPrintingPolicy(in QuantumBinding.Clang.Interop.CXPrintingPolicy __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXPrintingPolicyImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXPrintingPolicy GetNativeValue() => __Instance; /// /// Release a printing policy. /// @@ -53,14 +53,14 @@ public void PrintingPolicy_setProperty(CXPrintingPolicyProperty property, uint v QuantumBinding.Clang.Interop.ClangInterop.clang_PrintingPolicy_setProperty(this, property, value); } - public ref readonly CXPrintingPolicyImpl GetPinnableReference() => ref __Instance; + public ref readonly CXPrintingPolicy GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXPrintingPolicyImpl(QBPrintingPolicy q) + public static implicit operator QuantumBinding.Clang.Interop.CXPrintingPolicy(QBPrintingPolicy q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXPrintingPolicyImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXPrintingPolicy(); } - public static implicit operator QBPrintingPolicy(QuantumBinding.Clang.Interop.CXPrintingPolicyImpl q) + public static implicit operator QBPrintingPolicy(QuantumBinding.Clang.Interop.CXPrintingPolicy q) { return new QBPrintingPolicy(in q); } diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBRemapping.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBRemapping.cs index 88894b5..fd68f07 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBRemapping.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBRemapping.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// CINDEX_DEPRECATED - disabled to silence MSVC deprecation warnings /// -public unsafe partial class QBRemapping : IUnmanagedWrapper +public unsafe partial class QBRemapping : IUnmanagedWrapper { - internal CXRemappingImpl __Instance; + internal CXRemapping __Instance; public QBRemapping() { } - public QBRemapping(in QuantumBinding.Clang.Interop.CXRemappingImpl __Instance) + public QBRemapping(in QuantumBinding.Clang.Interop.CXRemapping __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXRemappingImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXRemapping GetNativeValue() => __Instance; public void Remap_dispose() { QuantumBinding.Clang.Interop.ClangInterop.clang_remap_dispose(this); @@ -68,14 +68,14 @@ public uint Remap_getNumFiles() return QuantumBinding.Clang.Interop.ClangInterop.clang_remap_getNumFiles(this); } - public ref readonly CXRemappingImpl GetPinnableReference() => ref __Instance; + public ref readonly CXRemapping GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXRemappingImpl(QBRemapping q) + public static implicit operator QuantumBinding.Clang.Interop.CXRemapping(QBRemapping q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXRemappingImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXRemapping(); } - public static implicit operator QBRemapping(QuantumBinding.Clang.Interop.CXRemappingImpl q) + public static implicit operator QBRemapping(QuantumBinding.Clang.Interop.CXRemapping q) { return new QBRemapping(in q); } diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBTranslationUnit.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBTranslationUnit.cs index 9a83d97..2dfeee9 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBTranslationUnit.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBTranslationUnit.cs @@ -113,8 +113,8 @@ int CalculateSize(string complete_filename, QBUnsavedFile unsaved_files) /// public CXErrorCode CreateAPISet(out QuantumBinding.Clang.QBAPISet out_api) { - CXAPISetImpl arg1; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_createAPISet(this, out arg1); + CXAPISetImpl arg1 = default; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_createAPISet(this, &arg1); out_api = new QBAPISet(arg1); return result; } @@ -191,7 +191,7 @@ int CalculateSize(QBCursorAndRangeVisitor visitor) try { ref System.Span currentCursor = ref mainBuffer; - var arg1 = file == null ? new CXFileImpl() : (CXFileImpl)file; + var arg1 = file == null ? new CXFile() : (CXFile)file; var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToNative(visitor, ref currentCursor); return QuantumBinding.Clang.Interop.ClangInterop.clang_findIncludesInFile(this, arg1, arg2); } @@ -204,7 +204,7 @@ int CalculateSize(QBCursorAndRangeVisitor visitor) public CXResult FindIncludesInFileWithBlock(QuantumBinding.Clang.QBFile param1, QuantumBinding.Clang.QBCursorAndRangeVisitorBlock param2) { - var arg1 = param1 == null ? new CXFileImpl() : (CXFileImpl)param1; + var arg1 = param1 == null ? new CXFile() : (CXFile)param1; var arg2 = param2 == null ? new _CXCursorAndRangeVisitorBlock() : (_CXCursorAndRangeVisitorBlock)param2; return QuantumBinding.Clang.Interop.ClangInterop.clang_findIncludesInFileWithBlock(this, arg1, arg2); } @@ -307,7 +307,7 @@ int CalculateSize(string file_name) /// public string GetFileContents(QuantumBinding.Clang.QBFile file, out ulong size) { - var arg1 = file == null ? new CXFileImpl() : (CXFileImpl)file; + var arg1 = file == null ? new CXFile() : (CXFile)file; var result = QuantumBinding.Clang.Interop.ClangInterop.clang_getFileContents(this, arg1, out size); return new string(result); } @@ -317,7 +317,7 @@ public string GetFileContents(QuantumBinding.Clang.QBFile file, out ulong size) /// public void GetInclusions(nuint visitor, QuantumBinding.Clang.QBClientData client_data) { - var arg2 = client_data == null ? new CXClientDataImpl() : (CXClientDataImpl)client_data; + var arg2 = client_data == null ? new CXClientData() : (CXClientData)client_data; QuantumBinding.Clang.Interop.ClangInterop.clang_getInclusions(this, visitor, arg2); } @@ -326,7 +326,7 @@ public void GetInclusions(nuint visitor, QuantumBinding.Clang.QBClientData clien /// public QBSourceLocation GetLocation(QuantumBinding.Clang.QBFile file, uint line, uint column) { - var arg1 = file == null ? new CXFileImpl() : (CXFileImpl)file; + var arg1 = file == null ? new CXFile() : (CXFile)file; return QuantumBinding.Clang.Interop.ClangInterop.clang_getLocation(this, arg1, line, column); } @@ -335,7 +335,7 @@ public QBSourceLocation GetLocation(QuantumBinding.Clang.QBFile file, uint line, /// public QBSourceLocation GetLocationForOffset(QuantumBinding.Clang.QBFile file, uint offset) { - var arg1 = file == null ? new CXFileImpl() : (CXFileImpl)file; + var arg1 = file == null ? new CXFile() : (CXFile)file; return QuantumBinding.Clang.Interop.ClangInterop.clang_getLocationForOffset(this, arg1, offset); } @@ -344,7 +344,7 @@ public QBSourceLocation GetLocationForOffset(QuantumBinding.Clang.QBFile file, u /// public QBModule GetModuleForFile(QuantumBinding.Clang.QBFile param1) { - var arg1 = param1 == null ? new CXFileImpl() : (CXFileImpl)param1; + var arg1 = param1 == null ? new CXFile() : (CXFile)param1; return QuantumBinding.Clang.Interop.ClangInterop.clang_getModuleForFile(this, arg1); } @@ -361,7 +361,7 @@ public uint GetNumDiagnostics() /// public QBSourceRangeList GetSkippedRanges(QuantumBinding.Clang.QBFile file) { - var arg1 = file == null ? new CXFileImpl() : (CXFileImpl)file; + var arg1 = file == null ? new CXFile() : (CXFile)file; var result = QuantumBinding.Clang.Interop.ClangInterop.clang_getSkippedRanges(this, arg1); var wrappedResult = new QBSourceRangeList(*result); NativeUtils.Free(result); @@ -516,7 +516,7 @@ public QBTargetInfo GetTranslationUnitTargetInfo() /// public uint IsFileMultipleIncludeGuarded(QuantumBinding.Clang.QBFile file) { - var arg1 = file == null ? new CXFileImpl() : (CXFileImpl)file; + var arg1 = file == null ? new CXFile() : (CXFile)file; return QuantumBinding.Clang.Interop.ClangInterop.clang_isFileMultipleIncludeGuarded(this, arg1); } @@ -525,7 +525,7 @@ public uint IsFileMultipleIncludeGuarded(QuantumBinding.Clang.QBFile file) /// public uint Module_getNumTopLevelHeaders(QuantumBinding.Clang.QBModule module) { - var arg1 = module == null ? new CXModuleImpl() : (CXModuleImpl)module; + var arg1 = module == null ? new CXModule() : (CXModule)module; return QuantumBinding.Clang.Interop.ClangInterop.clang_Module_getNumTopLevelHeaders(this, arg1); } @@ -534,7 +534,7 @@ public uint Module_getNumTopLevelHeaders(QuantumBinding.Clang.QBModule module) /// public QBFile Module_getTopLevelHeader(QuantumBinding.Clang.QBModule module, uint index) { - var arg1 = module == null ? new CXModuleImpl() : (CXModuleImpl)module; + var arg1 = module == null ? new CXModule() : (CXModule)module; return QuantumBinding.Clang.Interop.ClangInterop.clang_Module_getTopLevelHeader(this, arg1, index); } diff --git a/QuantumBinding.ClangPlayground/Generated/Classes/QBVirtualFileOverlay.cs b/QuantumBinding.ClangPlayground/Generated/Classes/QBVirtualFileOverlay.cs index c3dd6d8..1106b21 100644 --- a/QuantumBinding.ClangPlayground/Generated/Classes/QBVirtualFileOverlay.cs +++ b/QuantumBinding.ClangPlayground/Generated/Classes/QBVirtualFileOverlay.cs @@ -80,9 +80,12 @@ public CXErrorCode VirtualFileOverlay_setCaseSensitivity(int caseSensitive) /// /// Write out the CXVirtualFileOverlay object to a char buffer. /// - public CXErrorCode VirtualFileOverlay_writeToBuffer(uint options, out sbyte* out_buffer_ptr, out uint out_buffer_size) + public CXErrorCode VirtualFileOverlay_writeToBuffer(uint options, out nuint out_buffer_ptr, out uint out_buffer_size) { - return QuantumBinding.Clang.Interop.ClangInterop.clang_VirtualFileOverlay_writeToBuffer(this, options, out out_buffer_ptr, out out_buffer_size); + sbyte* arg2 = null; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_VirtualFileOverlay_writeToBuffer(this, options, out arg2, out out_buffer_size); + out_buffer_ptr = (nuint)arg2; + return result; } public ref readonly CXVirtualFileOverlayImpl GetPinnableReference() => ref __Instance; diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Delegates/CXCursorVisitor.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Delegates/CXCursorVisitor.cs index 1eb1b56..67dbda5 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Delegates/CXCursorVisitor.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Delegates/CXCursorVisitor.cs @@ -24,24 +24,24 @@ public CXCursorVisitor(nuint ptr) : this((void*) ptr) { } public CXCursorVisitor(void* ptr) { NativePointer = ptr; - InvokeFunc = (delegate* unmanaged)ptr; + InvokeFunc = (delegate* unmanaged)ptr; } - private delegate* unmanaged InvokeFunc; + private delegate* unmanaged InvokeFunc; public void* NativePointer { get; } - public CXChildVisitResult Invoke(QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXCursor parent, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public CXChildVisitResult Invoke(QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXCursor parent, QuantumBinding.Clang.Interop.CXClientData client_data) { return InvokeFunc(cursor, parent, client_data); } - public static CXChildVisitResult Invoke(void* ptr, QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXCursor parent, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public static CXChildVisitResult Invoke(void* ptr, QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXCursor parent, QuantumBinding.Clang.Interop.CXClientData client_data) { - return ((delegate* unmanaged)ptr)(cursor, parent, client_data); + return ((delegate* unmanaged)ptr)(cursor, parent, client_data); } - public static CXChildVisitResult Invoke(nuint ptr, QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXCursor parent, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public static CXChildVisitResult Invoke(nuint ptr, QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXCursor parent, QuantumBinding.Clang.Interop.CXClientData client_data) { - return ((delegate* unmanaged)(void*)ptr)(cursor, parent, client_data); + return ((delegate* unmanaged)(void*)ptr)(cursor, parent, client_data); } public static explicit operator CXCursorVisitor(void* ptr) => new(ptr); diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Delegates/CXFieldVisitor.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Delegates/CXFieldVisitor.cs index 1078948..69dc119 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Delegates/CXFieldVisitor.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Delegates/CXFieldVisitor.cs @@ -24,24 +24,24 @@ public CXFieldVisitor(nuint ptr) : this((void*) ptr) { } public CXFieldVisitor(void* ptr) { NativePointer = ptr; - InvokeFunc = (delegate* unmanaged)ptr; + InvokeFunc = (delegate* unmanaged)ptr; } - private delegate* unmanaged InvokeFunc; + private delegate* unmanaged InvokeFunc; public void* NativePointer { get; } - public CXVisitorResult Invoke(QuantumBinding.Clang.Interop.CXCursor C, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public CXVisitorResult Invoke(QuantumBinding.Clang.Interop.CXCursor C, QuantumBinding.Clang.Interop.CXClientData client_data) { return InvokeFunc(C, client_data); } - public static CXVisitorResult Invoke(void* ptr, QuantumBinding.Clang.Interop.CXCursor C, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public static CXVisitorResult Invoke(void* ptr, QuantumBinding.Clang.Interop.CXCursor C, QuantumBinding.Clang.Interop.CXClientData client_data) { - return ((delegate* unmanaged)ptr)(C, client_data); + return ((delegate* unmanaged)ptr)(C, client_data); } - public static CXVisitorResult Invoke(nuint ptr, QuantumBinding.Clang.Interop.CXCursor C, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public static CXVisitorResult Invoke(nuint ptr, QuantumBinding.Clang.Interop.CXCursor C, QuantumBinding.Clang.Interop.CXClientData client_data) { - return ((delegate* unmanaged)(void*)ptr)(C, client_data); + return ((delegate* unmanaged)(void*)ptr)(C, client_data); } public static explicit operator CXFieldVisitor(void* ptr) => new(ptr); diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Delegates/CXInclusionVisitor.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Delegates/CXInclusionVisitor.cs index 41e6ed6..c5de16f 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Delegates/CXInclusionVisitor.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Delegates/CXInclusionVisitor.cs @@ -24,24 +24,24 @@ public CXInclusionVisitor(nuint ptr) : this((void*) ptr) { } public CXInclusionVisitor(void* ptr) { NativePointer = ptr; - InvokeFunc = (delegate* unmanaged)ptr; + InvokeFunc = (delegate* unmanaged)ptr; } - private delegate* unmanaged InvokeFunc; + private delegate* unmanaged InvokeFunc; public void* NativePointer { get; } - public void Invoke(QuantumBinding.Clang.Interop.CXFileImpl included_file, QuantumBinding.Clang.Interop.CXSourceLocation* inclusion_stack, uint include_len, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public void Invoke(QuantumBinding.Clang.Interop.CXFile included_file, QuantumBinding.Clang.Interop.CXSourceLocation* inclusion_stack, uint include_len, QuantumBinding.Clang.Interop.CXClientData client_data) { InvokeFunc(included_file, inclusion_stack, include_len, client_data); } - public static void Invoke(void* ptr, QuantumBinding.Clang.Interop.CXFileImpl included_file, QuantumBinding.Clang.Interop.CXSourceLocation* inclusion_stack, uint include_len, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public static void Invoke(void* ptr, QuantumBinding.Clang.Interop.CXFile included_file, QuantumBinding.Clang.Interop.CXSourceLocation* inclusion_stack, uint include_len, QuantumBinding.Clang.Interop.CXClientData client_data) { - ((delegate* unmanaged)ptr)(included_file, inclusion_stack, include_len, client_data); + ((delegate* unmanaged)ptr)(included_file, inclusion_stack, include_len, client_data); } - public static void Invoke(nuint ptr, QuantumBinding.Clang.Interop.CXFileImpl included_file, QuantumBinding.Clang.Interop.CXSourceLocation* inclusion_stack, uint include_len, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public static void Invoke(nuint ptr, QuantumBinding.Clang.Interop.CXFile included_file, QuantumBinding.Clang.Interop.CXSourceLocation* inclusion_stack, uint include_len, QuantumBinding.Clang.Interop.CXClientData client_data) { - ((delegate* unmanaged)(void*)ptr)(included_file, inclusion_stack, include_len, client_data); + ((delegate* unmanaged)(void*)ptr)(included_file, inclusion_stack, include_len, client_data); } public static explicit operator CXInclusionVisitor(void* ptr) => new(ptr); diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Functions/QuantumBinding.Clang.Functions.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Functions/QuantumBinding.Clang.Functions.cs index c235fb4..d0c125a 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Functions/QuantumBinding.Clang.Functions.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Functions/QuantumBinding.Clang.Functions.cs @@ -76,7 +76,7 @@ public static unsafe partial class ClangInterop /// Retrieve a diagnostic associated with the given code completion. /// [DllImport(LibraryPath, EntryPoint = "clang_codeCompleteGetDiagnostic", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXDiagnosticImpl clang_codeCompleteGetDiagnostic(QuantumBinding.Clang.Interop.CXCodeCompleteResults* results, uint index); + internal static extern CXDiagnostic clang_codeCompleteGetDiagnostic(QuantumBinding.Clang.Interop.CXCodeCompleteResults* results, uint index); /// /// Determine the number of diagnostics produced prior to the location where code completion was performed. @@ -154,7 +154,7 @@ public static unsafe partial class ClangInterop /// Traverses the translation unit to create a CXAPISet. /// [DllImport(LibraryPath, EntryPoint = "clang_createAPISet", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXErrorCode clang_createAPISet(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, out QuantumBinding.Clang.Interop.CXAPISetImpl out_api); + internal static extern CXErrorCode clang_createAPISet(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXAPISetImpl* out_api); /// /// Creates an empty CXCursorSet. @@ -166,37 +166,37 @@ public static unsafe partial class ClangInterop /// Provides a shared context for creating translation units. /// [DllImport(LibraryPath, EntryPoint = "clang_createIndex", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXIndexImpl clang_createIndex(int excludeDeclarationsFromPCH, int displayDiagnostics); + internal static extern CXIndex clang_createIndex(int excludeDeclarationsFromPCH, int displayDiagnostics); /// /// Provides a shared context for creating translation units. /// [DllImport(LibraryPath, EntryPoint = "clang_createIndexWithOptions", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXIndexImpl clang_createIndexWithOptions(QuantumBinding.Clang.Interop.CXIndexOptions* options); + internal static extern CXIndex clang_createIndexWithOptions(QuantumBinding.Clang.Interop.CXIndexOptions* options); /// /// Same as clang_createTranslationUnit2, but returns the CXTranslationUnit instead of an error code. In case of an error this routine returns a NULL CXTranslationUnit, without further detailed error codes. /// [DllImport(LibraryPath, EntryPoint = "clang_createTranslationUnit", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXTranslationUnitImpl clang_createTranslationUnit(QuantumBinding.Clang.Interop.CXIndexImpl cIdx, sbyte* ast_filename); + internal static extern CXTranslationUnitImpl clang_createTranslationUnit(QuantumBinding.Clang.Interop.CXIndex cIdx, sbyte* ast_filename); /// /// Create a translation unit from an AST file ( -emit-ast). /// [DllImport(LibraryPath, EntryPoint = "clang_createTranslationUnit2", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXErrorCode clang_createTranslationUnit2(QuantumBinding.Clang.Interop.CXIndexImpl cIdx, sbyte* ast_filename, out QuantumBinding.Clang.Interop.CXTranslationUnitImpl out_TU); + internal static extern CXErrorCode clang_createTranslationUnit2(QuantumBinding.Clang.Interop.CXIndex cIdx, sbyte* ast_filename, QuantumBinding.Clang.Interop.CXTranslationUnitImpl* out_TU); /// /// Return the CXTranslationUnit for a given source file and the provided command line arguments one would pass to the compiler. /// [DllImport(LibraryPath, EntryPoint = "clang_createTranslationUnitFromSourceFile", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXTranslationUnitImpl clang_createTranslationUnitFromSourceFile(QuantumBinding.Clang.Interop.CXIndexImpl cIdx, sbyte* source_filename, int num_clang_command_line_args, sbyte** clang_command_line_args, uint num_unsaved_files, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files); + internal static extern CXTranslationUnitImpl clang_createTranslationUnitFromSourceFile(QuantumBinding.Clang.Interop.CXIndex cIdx, sbyte* source_filename, int num_clang_command_line_args, sbyte** clang_command_line_args, uint num_unsaved_files, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files); /// /// If cursor is a statement declaration tries to evaluate the statement and if its variable, tries to evaluate its initializer, into its corresponding type. If it's an expression, tries to evaluate the expression. /// [DllImport(LibraryPath, EntryPoint = "clang_Cursor_Evaluate", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXEvalResultImpl clang_Cursor_Evaluate(QuantumBinding.Clang.Interop.CXCursor c); + internal static extern CXEvalResult clang_Cursor_Evaluate(QuantumBinding.Clang.Interop.CXCursor c); /// /// Retrieve the argument cursor of a function or method. @@ -286,7 +286,7 @@ public static unsafe partial class ClangInterop /// Given a CXCursor_ModuleImportDecl cursor, return the associated module. /// [DllImport(LibraryPath, EntryPoint = "clang_Cursor_getModule", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXModuleImpl clang_Cursor_getModule(QuantumBinding.Clang.Interop.CXCursor c); + internal static extern CXModule clang_Cursor_getModule(QuantumBinding.Clang.Interop.CXCursor c); /// /// Retrieve the number of non-variadic arguments associated with a given cursor. @@ -454,7 +454,7 @@ public static unsafe partial class ClangInterop /// Returns non-zero if the given cursor points to a symbol marked with external_source_symbol attribute. /// [DllImport(LibraryPath, EntryPoint = "clang_Cursor_isExternalSymbol", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_Cursor_isExternalSymbol(QuantumBinding.Clang.Interop.CXCursor c, QuantumBinding.Clang.Interop.CXString* language, QuantumBinding.Clang.Interop.CXString* definedIn, uint* isGenerated); + internal static extern uint clang_Cursor_isExternalSymbol(QuantumBinding.Clang.Interop.CXCursor c, QuantumBinding.Clang.Interop.CXString* language, QuantumBinding.Clang.Interop.CXString* definedIn, ref uint isGenerated); /// /// Determine whether a CXCursor that is a function declaration, is an inline declaration. @@ -526,19 +526,19 @@ public static unsafe partial class ClangInterop /// Gets the general options associated with a CXIndex. /// [DllImport(LibraryPath, EntryPoint = "clang_CXIndex_getGlobalOptions", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_CXIndex_getGlobalOptions(QuantumBinding.Clang.Interop.CXIndexImpl param0); + internal static extern uint clang_CXIndex_getGlobalOptions(QuantumBinding.Clang.Interop.CXIndex param0); /// /// Sets general options associated with a CXIndex. /// [DllImport(LibraryPath, EntryPoint = "clang_CXIndex_setGlobalOptions", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_CXIndex_setGlobalOptions(QuantumBinding.Clang.Interop.CXIndexImpl param0, uint options); + internal static extern void clang_CXIndex_setGlobalOptions(QuantumBinding.Clang.Interop.CXIndex param0, uint options); /// /// Sets the invocation emission path option in a CXIndex. /// [DllImport(LibraryPath, EntryPoint = "clang_CXIndex_setInvocationEmissionPathOption", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_CXIndex_setInvocationEmissionPathOption(QuantumBinding.Clang.Interop.CXIndexImpl param0, sbyte* path); + internal static extern void clang_CXIndex_setInvocationEmissionPathOption(QuantumBinding.Clang.Interop.CXIndex param0, sbyte* path); /// /// Determine if a C++ constructor is a converting constructor. @@ -691,19 +691,19 @@ public static unsafe partial class ClangInterop /// Destroy a diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_disposeDiagnostic", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_disposeDiagnostic(QuantumBinding.Clang.Interop.CXDiagnosticImpl diagnostic); + internal static extern void clang_disposeDiagnostic(QuantumBinding.Clang.Interop.CXDiagnostic diagnostic); /// /// Release a CXDiagnosticSet and all of its contained diagnostics. /// [DllImport(LibraryPath, EntryPoint = "clang_disposeDiagnosticSet", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_disposeDiagnosticSet(QuantumBinding.Clang.Interop.CXDiagnosticSetImpl diags); + internal static extern void clang_disposeDiagnosticSet(QuantumBinding.Clang.Interop.CXDiagnosticSet diags); /// /// Destroy the given index. /// [DllImport(LibraryPath, EntryPoint = "clang_disposeIndex", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_disposeIndex(QuantumBinding.Clang.Interop.CXIndexImpl index); + internal static extern void clang_disposeIndex(QuantumBinding.Clang.Interop.CXIndex index); /// /// Free the set of overridden cursors returned by clang_getOverriddenCursors(). @@ -778,94 +778,94 @@ public static unsafe partial class ClangInterop /// Disposes the created Eval memory. /// [DllImport(LibraryPath, EntryPoint = "clang_EvalResult_dispose", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_EvalResult_dispose(QuantumBinding.Clang.Interop.CXEvalResultImpl e); + internal static extern void clang_EvalResult_dispose(QuantumBinding.Clang.Interop.CXEvalResult e); /// /// Returns the evaluation result as double if the kind is double. /// [DllImport(LibraryPath, EntryPoint = "clang_EvalResult_getAsDouble", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern double clang_EvalResult_getAsDouble(QuantumBinding.Clang.Interop.CXEvalResultImpl e); + internal static extern double clang_EvalResult_getAsDouble(QuantumBinding.Clang.Interop.CXEvalResult e); /// /// Returns the evaluation result as integer if the kind is Int. /// [DllImport(LibraryPath, EntryPoint = "clang_EvalResult_getAsInt", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern int clang_EvalResult_getAsInt(QuantumBinding.Clang.Interop.CXEvalResultImpl e); + internal static extern int clang_EvalResult_getAsInt(QuantumBinding.Clang.Interop.CXEvalResult e); /// /// Returns the evaluation result as a long long integer if the kind is Int. This prevents overflows that may happen if the result is returned with clang_EvalResult_getAsInt. /// [DllImport(LibraryPath, EntryPoint = "clang_EvalResult_getAsLongLong", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern long clang_EvalResult_getAsLongLong(QuantumBinding.Clang.Interop.CXEvalResultImpl e); + internal static extern long clang_EvalResult_getAsLongLong(QuantumBinding.Clang.Interop.CXEvalResult e); /// /// Returns the evaluation result as a constant string if the kind is other than Int or float. User must not free this pointer, instead call clang_EvalResult_dispose on the CXEvalResult returned by clang_Cursor_Evaluate. /// [DllImport(LibraryPath, EntryPoint = "clang_EvalResult_getAsStr", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern sbyte* clang_EvalResult_getAsStr(QuantumBinding.Clang.Interop.CXEvalResultImpl e); + internal static extern sbyte* clang_EvalResult_getAsStr(QuantumBinding.Clang.Interop.CXEvalResult e); /// /// Returns the evaluation result as an unsigned integer if the kind is Int and clang_EvalResult_isUnsignedInt is non-zero. /// [DllImport(LibraryPath, EntryPoint = "clang_EvalResult_getAsUnsigned", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern ulong clang_EvalResult_getAsUnsigned(QuantumBinding.Clang.Interop.CXEvalResultImpl e); + internal static extern ulong clang_EvalResult_getAsUnsigned(QuantumBinding.Clang.Interop.CXEvalResult e); /// /// Returns the kind of the evaluated result. /// [DllImport(LibraryPath, EntryPoint = "clang_EvalResult_getKind", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXEvalResultKind clang_EvalResult_getKind(QuantumBinding.Clang.Interop.CXEvalResultImpl e); + internal static extern CXEvalResultKind clang_EvalResult_getKind(QuantumBinding.Clang.Interop.CXEvalResult e); /// /// Returns a non-zero value if the kind is Int and the evaluation result resulted in an unsigned integer. /// [DllImport(LibraryPath, EntryPoint = "clang_EvalResult_isUnsignedInt", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_EvalResult_isUnsignedInt(QuantumBinding.Clang.Interop.CXEvalResultImpl e); + internal static extern uint clang_EvalResult_isUnsignedInt(QuantumBinding.Clang.Interop.CXEvalResult e); [DllImport(LibraryPath, EntryPoint = "clang_executeOnThread", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_executeOnThread(nuint fn, nuint user_data, uint stack_size); + internal static extern void clang_executeOnThread(void* fn, void* user_data, uint stack_size); /// /// Returns non-zero if the file1 and file2 point to the same file, or they are both NULL. /// [DllImport(LibraryPath, EntryPoint = "clang_File_isEqual", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern int clang_File_isEqual(QuantumBinding.Clang.Interop.CXFileImpl file1, QuantumBinding.Clang.Interop.CXFileImpl file2); + internal static extern int clang_File_isEqual(QuantumBinding.Clang.Interop.CXFile file1, QuantumBinding.Clang.Interop.CXFile file2); /// /// Returns the real path name of file. /// [DllImport(LibraryPath, EntryPoint = "clang_File_tryGetRealPathName", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_File_tryGetRealPathName(QuantumBinding.Clang.Interop.CXFileImpl file); + internal static extern CXString clang_File_tryGetRealPathName(QuantumBinding.Clang.Interop.CXFile file); /// /// Find #import/#include directives in a specific file. /// [DllImport(LibraryPath, EntryPoint = "clang_findIncludesInFile", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXResult clang_findIncludesInFile(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tU, QuantumBinding.Clang.Interop.CXFileImpl file, QuantumBinding.Clang.Interop.CXCursorAndRangeVisitor visitor); + internal static extern CXResult clang_findIncludesInFile(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tU, QuantumBinding.Clang.Interop.CXFile file, QuantumBinding.Clang.Interop.CXCursorAndRangeVisitor visitor); [DllImport(LibraryPath, EntryPoint = "clang_findIncludesInFileWithBlock", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXResult clang_findIncludesInFileWithBlock(QuantumBinding.Clang.Interop.CXTranslationUnitImpl param0, QuantumBinding.Clang.Interop.CXFileImpl param1, QuantumBinding.Clang.Interop._CXCursorAndRangeVisitorBlock param2); + internal static extern CXResult clang_findIncludesInFileWithBlock(QuantumBinding.Clang.Interop.CXTranslationUnitImpl param0, QuantumBinding.Clang.Interop.CXFile param1, QuantumBinding.Clang.Interop._CXCursorAndRangeVisitorBlock param2); /// /// Find references of a declaration in a specific file. /// [DllImport(LibraryPath, EntryPoint = "clang_findReferencesInFile", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXResult clang_findReferencesInFile(QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXFileImpl file, QuantumBinding.Clang.Interop.CXCursorAndRangeVisitor visitor); + internal static extern CXResult clang_findReferencesInFile(QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXFile file, QuantumBinding.Clang.Interop.CXCursorAndRangeVisitor visitor); [DllImport(LibraryPath, EntryPoint = "clang_findReferencesInFileWithBlock", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXResult clang_findReferencesInFileWithBlock(QuantumBinding.Clang.Interop.CXCursor param0, QuantumBinding.Clang.Interop.CXFileImpl param1, QuantumBinding.Clang.Interop._CXCursorAndRangeVisitorBlock param2); + internal static extern CXResult clang_findReferencesInFileWithBlock(QuantumBinding.Clang.Interop.CXCursor param0, QuantumBinding.Clang.Interop.CXFile param1, QuantumBinding.Clang.Interop._CXCursorAndRangeVisitorBlock param2); /// /// Format the given diagnostic in a manner that is suitable for display. /// [DllImport(LibraryPath, EntryPoint = "clang_formatDiagnostic", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_formatDiagnostic(QuantumBinding.Clang.Interop.CXDiagnosticImpl diagnostic, uint options); + internal static extern CXString clang_formatDiagnostic(QuantumBinding.Clang.Interop.CXDiagnostic diagnostic, uint options); /// /// free memory allocated by libclang, such as the buffer returned by CXVirtualFileOverlay() or clang_ModuleMapDescriptor_writeToBuffer(). /// [DllImport(LibraryPath, EntryPoint = "clang_free", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_free(nuint buffer); + internal static extern void clang_free(void* buffer); /// /// Convert a given full parsed comment to an HTML fragment. @@ -937,7 +937,7 @@ public static unsafe partial class ClangInterop /// Retrieve the child diagnostics of a CXDiagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getChildDiagnostics", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXDiagnosticSetImpl clang_getChildDiagnostics(QuantumBinding.Clang.Interop.CXDiagnosticImpl d); + internal static extern CXDiagnosticSet clang_getChildDiagnostics(QuantumBinding.Clang.Interop.CXDiagnostic d); /// /// Return a version string, suitable for showing to a user, but not intended to be parsed (the format is not guaranteed to be stable). @@ -949,37 +949,37 @@ public static unsafe partial class ClangInterop /// Retrieve the annotation associated with the given completion string. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionAnnotation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getCompletionAnnotation(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string, uint annotation_number); + internal static extern CXString clang_getCompletionAnnotation(QuantumBinding.Clang.Interop.CXCompletionString completion_string, uint annotation_number); /// /// Determine the availability of the entity that this code-completion string refers to. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionAvailability", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXAvailabilityKind clang_getCompletionAvailability(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string); + internal static extern CXAvailabilityKind clang_getCompletionAvailability(QuantumBinding.Clang.Interop.CXCompletionString completion_string); /// /// Retrieve the brief documentation comment attached to the declaration that corresponds to the given completion string. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionBriefComment", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getCompletionBriefComment(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string); + internal static extern CXString clang_getCompletionBriefComment(QuantumBinding.Clang.Interop.CXCompletionString completion_string); /// /// Retrieve the completion string associated with a particular chunk within a completion string. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionChunkCompletionString", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXCompletionStringImpl clang_getCompletionChunkCompletionString(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string, uint chunk_number); + internal static extern CXCompletionString clang_getCompletionChunkCompletionString(QuantumBinding.Clang.Interop.CXCompletionString completion_string, uint chunk_number); /// /// Determine the kind of a particular chunk within a completion string. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionChunkKind", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXCompletionChunkKind clang_getCompletionChunkKind(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string, uint chunk_number); + internal static extern CXCompletionChunkKind clang_getCompletionChunkKind(QuantumBinding.Clang.Interop.CXCompletionString completion_string, uint chunk_number); /// /// Retrieve the text associated with a particular chunk within a completion string. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionChunkText", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getCompletionChunkText(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string, uint chunk_number); + internal static extern CXString clang_getCompletionChunkText(QuantumBinding.Clang.Interop.CXCompletionString completion_string, uint chunk_number); /// /// Fix-its that *must* be applied before inserting the text for the corresponding completion. @@ -991,7 +991,7 @@ public static unsafe partial class ClangInterop /// Retrieve the number of annotations associated with the given completion string. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionNumAnnotations", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_getCompletionNumAnnotations(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string); + internal static extern uint clang_getCompletionNumAnnotations(QuantumBinding.Clang.Interop.CXCompletionString completion_string); /// /// Retrieve the number of fix-its for the given completion index. @@ -1003,13 +1003,13 @@ public static unsafe partial class ClangInterop /// Retrieve the parent context of the given completion string. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionParent", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getCompletionParent(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string, CXCursorKind* kind); + internal static extern CXString clang_getCompletionParent(QuantumBinding.Clang.Interop.CXCompletionString completion_string, CXCursorKind* kind); /// /// Determine the priority of this code completion. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionPriority", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_getCompletionPriority(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string); + internal static extern uint clang_getCompletionPriority(QuantumBinding.Clang.Interop.CXCompletionString completion_string); /// /// Retrieve the character data associated with the given string. @@ -1039,7 +1039,7 @@ public static unsafe partial class ClangInterop /// Retrieve a completion string for an arbitrary declaration or macro definition cursor. /// [DllImport(LibraryPath, EntryPoint = "clang_getCursorCompletionString", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXCompletionStringImpl clang_getCursorCompletionString(QuantumBinding.Clang.Interop.CXCursor cursor); + internal static extern CXCompletionString clang_getCursorCompletionString(QuantumBinding.Clang.Interop.CXCursor cursor); /// /// For a cursor that is either a reference to or a declaration of some entity, retrieve a cursor that describes the definition of that entity. @@ -1105,19 +1105,19 @@ public static unsafe partial class ClangInterop /// Determine the availability of the entity that this cursor refers to on any platforms for which availability information is known. /// [DllImport(LibraryPath, EntryPoint = "clang_getCursorPlatformAvailability", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern int clang_getCursorPlatformAvailability(QuantumBinding.Clang.Interop.CXCursor cursor, int* always_deprecated, QuantumBinding.Clang.Interop.CXString* deprecated_message, int* always_unavailable, QuantumBinding.Clang.Interop.CXString* unavailable_message, QuantumBinding.Clang.Interop.CXPlatformAvailability* availability, int availability_size); + internal static extern int clang_getCursorPlatformAvailability(QuantumBinding.Clang.Interop.CXCursor cursor, int* always_deprecated, QuantumBinding.Clang.Interop.CXString* deprecated_message, ref int always_unavailable, QuantumBinding.Clang.Interop.CXString* unavailable_message, QuantumBinding.Clang.Interop.CXPlatformAvailability* availability, int availability_size); /// /// Pretty print declarations. /// [DllImport(LibraryPath, EntryPoint = "clang_getCursorPrettyPrinted", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getCursorPrettyPrinted(QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXPrintingPolicyImpl policy); + internal static extern CXString clang_getCursorPrettyPrinted(QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXPrintingPolicy policy); /// /// Retrieve the default policy for the cursor. /// [DllImport(LibraryPath, EntryPoint = "clang_getCursorPrintingPolicy", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXPrintingPolicyImpl clang_getCursorPrintingPolicy(QuantumBinding.Clang.Interop.CXCursor param0); + internal static extern CXPrintingPolicy clang_getCursorPrintingPolicy(QuantumBinding.Clang.Interop.CXCursor param0); /// /// For a cursor that is a reference, retrieve a cursor representing the entity that it references. @@ -1198,19 +1198,19 @@ public static unsafe partial class ClangInterop internal static extern CXString clang_getDeclObjCTypeEncoding(QuantumBinding.Clang.Interop.CXCursor c); [DllImport(LibraryPath, EntryPoint = "clang_getDefinitionSpellingAndExtent", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_getDefinitionSpellingAndExtent(QuantumBinding.Clang.Interop.CXCursor param0, sbyte** startBuf, sbyte** endBuf, uint* startLine, uint* startColumn, uint* endLine, uint* endColumn); + internal static extern void clang_getDefinitionSpellingAndExtent(QuantumBinding.Clang.Interop.CXCursor param0, sbyte** startBuf, sbyte** endBuf, ref uint startLine, ref uint startColumn, ref uint endLine, ref uint endColumn); /// /// Retrieve a diagnostic associated with the given translation unit. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnostic", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXDiagnosticImpl clang_getDiagnostic(QuantumBinding.Clang.Interop.CXTranslationUnitImpl unit, uint index); + internal static extern CXDiagnostic clang_getDiagnostic(QuantumBinding.Clang.Interop.CXTranslationUnitImpl unit, uint index); /// /// Retrieve the category number for this diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticCategory", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_getDiagnosticCategory(QuantumBinding.Clang.Interop.CXDiagnosticImpl param0); + internal static extern uint clang_getDiagnosticCategory(QuantumBinding.Clang.Interop.CXDiagnostic param0); /// /// Retrieve the name of a particular diagnostic category. This is now deprecated. Use clang_getDiagnosticCategoryText() instead. @@ -1222,67 +1222,67 @@ public static unsafe partial class ClangInterop /// Retrieve the diagnostic category text for a given diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticCategoryText", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getDiagnosticCategoryText(QuantumBinding.Clang.Interop.CXDiagnosticImpl param0); + internal static extern CXString clang_getDiagnosticCategoryText(QuantumBinding.Clang.Interop.CXDiagnostic param0); /// /// Retrieve the replacement information for a given fix-it. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticFixIt", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getDiagnosticFixIt(QuantumBinding.Clang.Interop.CXDiagnosticImpl diagnostic, uint fixIt, QuantumBinding.Clang.Interop.CXSourceRange* replacementRange); + internal static extern CXString clang_getDiagnosticFixIt(QuantumBinding.Clang.Interop.CXDiagnostic diagnostic, uint fixIt, QuantumBinding.Clang.Interop.CXSourceRange* replacementRange); /// /// Retrieve a diagnostic associated with the given CXDiagnosticSet. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticInSet", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXDiagnosticImpl clang_getDiagnosticInSet(QuantumBinding.Clang.Interop.CXDiagnosticSetImpl diags, uint index); + internal static extern CXDiagnostic clang_getDiagnosticInSet(QuantumBinding.Clang.Interop.CXDiagnosticSet diags, uint index); /// /// Retrieve the source location of the given diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticLocation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXSourceLocation clang_getDiagnosticLocation(QuantumBinding.Clang.Interop.CXDiagnosticImpl param0); + internal static extern CXSourceLocation clang_getDiagnosticLocation(QuantumBinding.Clang.Interop.CXDiagnostic param0); /// /// Determine the number of fix-it hints associated with the given diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticNumFixIts", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_getDiagnosticNumFixIts(QuantumBinding.Clang.Interop.CXDiagnosticImpl diagnostic); + internal static extern uint clang_getDiagnosticNumFixIts(QuantumBinding.Clang.Interop.CXDiagnostic diagnostic); /// /// Determine the number of source ranges associated with the given diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticNumRanges", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_getDiagnosticNumRanges(QuantumBinding.Clang.Interop.CXDiagnosticImpl param0); + internal static extern uint clang_getDiagnosticNumRanges(QuantumBinding.Clang.Interop.CXDiagnostic param0); /// /// Retrieve the name of the command-line option that enabled this diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticOption", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getDiagnosticOption(QuantumBinding.Clang.Interop.CXDiagnosticImpl diag, QuantumBinding.Clang.Interop.CXString* disable); + internal static extern CXString clang_getDiagnosticOption(QuantumBinding.Clang.Interop.CXDiagnostic diag, QuantumBinding.Clang.Interop.CXString* disable); /// /// Retrieve a source range associated with the diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticRange", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXSourceRange clang_getDiagnosticRange(QuantumBinding.Clang.Interop.CXDiagnosticImpl diagnostic, uint range); + internal static extern CXSourceRange clang_getDiagnosticRange(QuantumBinding.Clang.Interop.CXDiagnostic diagnostic, uint range); /// /// Retrieve the complete set of diagnostics associated with a translation unit. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticSetFromTU", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXDiagnosticSetImpl clang_getDiagnosticSetFromTU(QuantumBinding.Clang.Interop.CXTranslationUnitImpl unit); + internal static extern CXDiagnosticSet clang_getDiagnosticSetFromTU(QuantumBinding.Clang.Interop.CXTranslationUnitImpl unit); /// /// Determine the severity of the given diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticSeverity", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXDiagnosticSeverity clang_getDiagnosticSeverity(QuantumBinding.Clang.Interop.CXDiagnosticImpl param0); + internal static extern CXDiagnosticSeverity clang_getDiagnosticSeverity(QuantumBinding.Clang.Interop.CXDiagnostic param0); /// /// Retrieve the text of the given diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticSpelling", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getDiagnosticSpelling(QuantumBinding.Clang.Interop.CXDiagnosticImpl param0); + internal static extern CXString clang_getDiagnosticSpelling(QuantumBinding.Clang.Interop.CXDiagnostic param0); /// /// Return the element type of an array, complex, or vector type. @@ -1318,7 +1318,7 @@ public static unsafe partial class ClangInterop /// Retrieve the file, line, column, and offset represented by the given source location. /// [DllImport(LibraryPath, EntryPoint = "clang_getExpansionLocation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_getExpansionLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, out QuantumBinding.Clang.Interop.CXFileImpl file, out uint line, out uint column, out uint offset); + internal static extern void clang_getExpansionLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, QuantumBinding.Clang.Interop.CXFile* file, out uint line, out uint column, out uint offset); /// /// Retrieve the bit width of a bit-field declaration as an integer. @@ -1330,43 +1330,43 @@ public static unsafe partial class ClangInterop /// Retrieve a file handle within the given translation unit. /// [DllImport(LibraryPath, EntryPoint = "clang_getFile", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXFileImpl clang_getFile(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, sbyte* file_name); + internal static extern CXFile clang_getFile(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, sbyte* file_name); /// /// Retrieve the buffer associated with the given file. /// [DllImport(LibraryPath, EntryPoint = "clang_getFileContents", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern sbyte* clang_getFileContents(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFileImpl file, out ulong size); + internal static extern sbyte* clang_getFileContents(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFile file, out ulong size); /// /// Retrieve the file, line, column, and offset represented by the given source location. /// [DllImport(LibraryPath, EntryPoint = "clang_getFileLocation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_getFileLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, out QuantumBinding.Clang.Interop.CXFileImpl file, out uint line, out uint column, out uint offset); + internal static extern void clang_getFileLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, QuantumBinding.Clang.Interop.CXFile* file, out uint line, out uint column, out uint offset); /// /// Retrieve the complete file and path name of the given file. /// [DllImport(LibraryPath, EntryPoint = "clang_getFileName", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getFileName(QuantumBinding.Clang.Interop.CXFileImpl sFile); + internal static extern CXString clang_getFileName(QuantumBinding.Clang.Interop.CXFile sFile); /// /// Retrieve the last modification time of the given file. /// [DllImport(LibraryPath, EntryPoint = "clang_getFileTime", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern long clang_getFileTime(QuantumBinding.Clang.Interop.CXFileImpl sFile); + internal static extern long clang_getFileTime(QuantumBinding.Clang.Interop.CXFile sFile); /// /// Retrieve the unique ID for the given file. /// [DllImport(LibraryPath, EntryPoint = "clang_getFileUniqueID", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern int clang_getFileUniqueID(QuantumBinding.Clang.Interop.CXFileImpl file, out QuantumBinding.Clang.Interop.CXFileUniqueID outID); + internal static extern int clang_getFileUniqueID(QuantumBinding.Clang.Interop.CXFile file, QuantumBinding.Clang.Interop.CXFileUniqueID* outID); /// /// Get the fully qualified name for a type. /// [DllImport(LibraryPath, EntryPoint = "clang_getFullyQualifiedName", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getFullyQualifiedName(QuantumBinding.Clang.Interop.CXType cT, QuantumBinding.Clang.Interop.CXPrintingPolicyImpl policy, uint withGlobalNsPrefix); + internal static extern CXString clang_getFullyQualifiedName(QuantumBinding.Clang.Interop.CXType cT, QuantumBinding.Clang.Interop.CXPrintingPolicy policy, uint withGlobalNsPrefix); /// /// Retrieve the calling convention associated with a function type. @@ -1384,37 +1384,37 @@ public static unsafe partial class ClangInterop /// Retrieve the file that is included by the given inclusion directive cursor. /// [DllImport(LibraryPath, EntryPoint = "clang_getIncludedFile", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXFileImpl clang_getIncludedFile(QuantumBinding.Clang.Interop.CXCursor cursor); + internal static extern CXFile clang_getIncludedFile(QuantumBinding.Clang.Interop.CXCursor cursor); /// /// Visit the set of preprocessor inclusions in a translation unit. The visitor function is called with the provided data for every included file. This does not include headers included by the PCH file (unless one is inspecting the inclusions in the PCH file itself). /// [DllImport(LibraryPath, EntryPoint = "clang_getInclusions", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_getInclusions(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, nuint visitor, QuantumBinding.Clang.Interop.CXClientDataImpl client_data); + internal static extern void clang_getInclusions(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, nuint visitor, QuantumBinding.Clang.Interop.CXClientData client_data); /// /// Legacy API to retrieve the file, line, column, and offset represented by the given source location. /// [DllImport(LibraryPath, EntryPoint = "clang_getInstantiationLocation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_getInstantiationLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, out QuantumBinding.Clang.Interop.CXFileImpl file, out uint line, out uint column, out uint offset); + internal static extern void clang_getInstantiationLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, QuantumBinding.Clang.Interop.CXFile* file, out uint line, out uint column, out uint offset); /// /// Retrieves the source location associated with a given file/line/column in a particular translation unit. /// [DllImport(LibraryPath, EntryPoint = "clang_getLocation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXSourceLocation clang_getLocation(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFileImpl file, uint line, uint column); + internal static extern CXSourceLocation clang_getLocation(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFile file, uint line, uint column); /// /// Retrieves the source location associated with a given character offset in a particular translation unit. /// [DllImport(LibraryPath, EntryPoint = "clang_getLocationForOffset", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXSourceLocation clang_getLocationForOffset(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFileImpl file, uint offset); + internal static extern CXSourceLocation clang_getLocationForOffset(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFile file, uint offset); /// /// Given a CXFile header file, return the module that contains it, if one exists. /// [DllImport(LibraryPath, EntryPoint = "clang_getModuleForFile", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXModuleImpl clang_getModuleForFile(QuantumBinding.Clang.Interop.CXTranslationUnitImpl param0, QuantumBinding.Clang.Interop.CXFileImpl param1); + internal static extern CXModule clang_getModuleForFile(QuantumBinding.Clang.Interop.CXTranslationUnitImpl param0, QuantumBinding.Clang.Interop.CXFile param1); /// /// For reference types (e.g., "const int&"), returns the type that the reference refers to (e.g "const int"). @@ -1450,7 +1450,7 @@ public static unsafe partial class ClangInterop /// Retrieve the number of chunks in the given code-completion string. /// [DllImport(LibraryPath, EntryPoint = "clang_getNumCompletionChunks", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_getNumCompletionChunks(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string); + internal static extern uint clang_getNumCompletionChunks(QuantumBinding.Clang.Interop.CXCompletionString completion_string); /// /// Determine the number of diagnostics produced for the given translation unit. @@ -1462,7 +1462,7 @@ public static unsafe partial class ClangInterop /// Determine the number of diagnostics in a CXDiagnosticSet. /// [DllImport(LibraryPath, EntryPoint = "clang_getNumDiagnosticsInSet", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_getNumDiagnosticsInSet(QuantumBinding.Clang.Interop.CXDiagnosticSetImpl diags); + internal static extern uint clang_getNumDiagnosticsInSet(QuantumBinding.Clang.Interop.CXDiagnosticSet diags); /// /// Return the number of elements of an array or vector type. @@ -1504,7 +1504,7 @@ public static unsafe partial class ClangInterop /// Retrieve the file, line and column represented by the given source location, as specified in a # line directive. /// [DllImport(LibraryPath, EntryPoint = "clang_getPresumedLocation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_getPresumedLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, out QuantumBinding.Clang.Interop.CXString filename, out uint line, out uint column); + internal static extern void clang_getPresumedLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, QuantumBinding.Clang.Interop.CXString* filename, out uint line, out uint column); /// /// Retrieve a source range given the beginning and ending source locations. @@ -1525,10 +1525,10 @@ public static unsafe partial class ClangInterop internal static extern CXSourceLocation clang_getRangeStart(QuantumBinding.Clang.Interop.CXSourceRange range); [DllImport(LibraryPath, EntryPoint = "clang_getRemappings", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXRemappingImpl clang_getRemappings(sbyte* param0); + internal static extern CXRemapping clang_getRemappings(sbyte* param0); [DllImport(LibraryPath, EntryPoint = "clang_getRemappingsFromFileList", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXRemappingImpl clang_getRemappingsFromFileList(sbyte** param0, uint param1); + internal static extern CXRemapping clang_getRemappingsFromFileList(sbyte** param0, uint param1); /// /// Retrieve the return type associated with a function type. @@ -1540,7 +1540,7 @@ public static unsafe partial class ClangInterop /// Retrieve all ranges that were skipped by the preprocessor. /// [DllImport(LibraryPath, EntryPoint = "clang_getSkippedRanges", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXSourceRangeList* clang_getSkippedRanges(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFileImpl file); + internal static extern CXSourceRangeList* clang_getSkippedRanges(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFile file); /// /// Given a cursor that may represent a specialization or instantiation of a template, retrieve the cursor that represents the template that it specializes or from which it was instantiated. @@ -1552,7 +1552,7 @@ public static unsafe partial class ClangInterop /// Retrieve the file, line, column, and offset represented by the given source location. /// [DllImport(LibraryPath, EntryPoint = "clang_getSpellingLocation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_getSpellingLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, out QuantumBinding.Clang.Interop.CXFileImpl file, out uint line, out uint column, out uint offset); + internal static extern void clang_getSpellingLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, QuantumBinding.Clang.Interop.CXFile* file, out uint line, out uint column, out uint offset); /// /// Generate a single symbol symbol graph for the declaration at the given cursor. Returns a null string if the AST node for the cursor isn't a declaration. @@ -1654,7 +1654,7 @@ public static unsafe partial class ClangInterop /// Pretty-print the underlying type using a custom printing policy. /// [DllImport(LibraryPath, EntryPoint = "clang_getTypePrettyPrinted", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getTypePrettyPrinted(QuantumBinding.Clang.Interop.CXType cT, QuantumBinding.Clang.Interop.CXPrintingPolicyImpl cxPolicy); + internal static extern CXString clang_getTypePrettyPrinted(QuantumBinding.Clang.Interop.CXType cT, QuantumBinding.Clang.Interop.CXPrintingPolicy cxPolicy); /// /// Pretty-print the underlying type using the rules of the language of the translation unit from which it came. @@ -1720,13 +1720,13 @@ public static unsafe partial class ClangInterop /// For retrieving a custom CXIdxClientContainer attached to a container. /// [DllImport(LibraryPath, EntryPoint = "clang_index_getClientContainer", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXIdxClientContainerImpl clang_index_getClientContainer(QuantumBinding.Clang.Interop.CXIdxContainerInfo* param0); + internal static extern CXIdxClientContainer clang_index_getClientContainer(QuantumBinding.Clang.Interop.CXIdxContainerInfo* param0); /// /// For retrieving a custom CXIdxClientEntity attached to an entity. /// [DllImport(LibraryPath, EntryPoint = "clang_index_getClientEntity", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXIdxClientEntityImpl clang_index_getClientEntity(QuantumBinding.Clang.Interop.CXIdxEntityInfo* param0); + internal static extern CXIdxClientEntity clang_index_getClientEntity(QuantumBinding.Clang.Interop.CXIdxEntityInfo* param0); [DllImport(LibraryPath, EntryPoint = "clang_index_getCXXClassDeclInfo", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] internal static extern CXIdxCXXClassDeclInfo* clang_index_getCXXClassDeclInfo(QuantumBinding.Clang.Interop.CXIdxDeclInfo* param0); @@ -1756,25 +1756,25 @@ public static unsafe partial class ClangInterop /// For setting a custom CXIdxClientContainer attached to a container. /// [DllImport(LibraryPath, EntryPoint = "clang_index_setClientContainer", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_index_setClientContainer(QuantumBinding.Clang.Interop.CXIdxContainerInfo* param0, QuantumBinding.Clang.Interop.CXIdxClientContainerImpl param1); + internal static extern void clang_index_setClientContainer(QuantumBinding.Clang.Interop.CXIdxContainerInfo* param0, QuantumBinding.Clang.Interop.CXIdxClientContainer param1); /// /// For setting a custom CXIdxClientEntity attached to an entity. /// [DllImport(LibraryPath, EntryPoint = "clang_index_setClientEntity", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_index_setClientEntity(QuantumBinding.Clang.Interop.CXIdxEntityInfo* param0, QuantumBinding.Clang.Interop.CXIdxClientEntityImpl param1); + internal static extern void clang_index_setClientEntity(QuantumBinding.Clang.Interop.CXIdxEntityInfo* param0, QuantumBinding.Clang.Interop.CXIdxClientEntity param1); /// /// An indexing action/session, to be applied to one or multiple translation units. /// [DllImport(LibraryPath, EntryPoint = "clang_IndexAction_create", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXIndexActionImpl clang_IndexAction_create(QuantumBinding.Clang.Interop.CXIndexImpl cIdx); + internal static extern CXIndexAction clang_IndexAction_create(QuantumBinding.Clang.Interop.CXIndex cIdx); /// /// Destroy the given index action. /// [DllImport(LibraryPath, EntryPoint = "clang_IndexAction_dispose", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_IndexAction_dispose(QuantumBinding.Clang.Interop.CXIndexActionImpl param0); + internal static extern void clang_IndexAction_dispose(QuantumBinding.Clang.Interop.CXIndexAction param0); /// /// Retrieve the CXSourceLocation represented by the given CXIdxLoc. @@ -1786,25 +1786,25 @@ public static unsafe partial class ClangInterop /// Retrieve the CXIdxFile, file, line, column, and offset represented by the given CXIdxLoc. /// [DllImport(LibraryPath, EntryPoint = "clang_indexLoc_getFileLocation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_indexLoc_getFileLocation(QuantumBinding.Clang.Interop.CXIdxLoc loc, out QuantumBinding.Clang.Interop.CXIdxClientFileImpl indexFile, out QuantumBinding.Clang.Interop.CXFileImpl file, out uint line, out uint column, out uint offset); + internal static extern void clang_indexLoc_getFileLocation(QuantumBinding.Clang.Interop.CXIdxLoc loc, QuantumBinding.Clang.Interop.CXIdxClientFile* indexFile, QuantumBinding.Clang.Interop.CXFile* file, out uint line, out uint column, out uint offset); /// /// Index the given source file and the translation unit corresponding to that file via callbacks implemented through #IndexerCallbacks. /// [DllImport(LibraryPath, EntryPoint = "clang_indexSourceFile", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern int clang_indexSourceFile(QuantumBinding.Clang.Interop.CXIndexActionImpl param0, QuantumBinding.Clang.Interop.CXClientDataImpl client_data, QuantumBinding.Clang.Interop.IndexerCallbacks* index_callbacks, uint index_callbacks_size, uint index_options, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, out QuantumBinding.Clang.Interop.CXTranslationUnitImpl out_TU, uint tU_options); + internal static extern int clang_indexSourceFile(QuantumBinding.Clang.Interop.CXIndexAction param0, QuantumBinding.Clang.Interop.CXClientData client_data, QuantumBinding.Clang.Interop.IndexerCallbacks* index_callbacks, uint index_callbacks_size, uint index_options, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, QuantumBinding.Clang.Interop.CXTranslationUnitImpl* out_TU, uint tU_options); /// /// Same as clang_indexSourceFile but requires a full command line for command_line_args including argv[0]. This is useful if the standard library paths are relative to the binary. /// [DllImport(LibraryPath, EntryPoint = "clang_indexSourceFileFullArgv", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern int clang_indexSourceFileFullArgv(QuantumBinding.Clang.Interop.CXIndexActionImpl param0, QuantumBinding.Clang.Interop.CXClientDataImpl client_data, QuantumBinding.Clang.Interop.IndexerCallbacks* index_callbacks, uint index_callbacks_size, uint index_options, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, out QuantumBinding.Clang.Interop.CXTranslationUnitImpl out_TU, uint tU_options); + internal static extern int clang_indexSourceFileFullArgv(QuantumBinding.Clang.Interop.CXIndexAction param0, QuantumBinding.Clang.Interop.CXClientData client_data, QuantumBinding.Clang.Interop.IndexerCallbacks* index_callbacks, uint index_callbacks_size, uint index_options, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, QuantumBinding.Clang.Interop.CXTranslationUnitImpl* out_TU, uint tU_options); /// /// Index the given translation unit via callbacks implemented through #IndexerCallbacks. /// [DllImport(LibraryPath, EntryPoint = "clang_indexTranslationUnit", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern int clang_indexTranslationUnit(QuantumBinding.Clang.Interop.CXIndexActionImpl param0, QuantumBinding.Clang.Interop.CXClientDataImpl client_data, QuantumBinding.Clang.Interop.IndexerCallbacks* index_callbacks, uint index_callbacks_size, uint index_options, QuantumBinding.Clang.Interop.CXTranslationUnitImpl param5); + internal static extern int clang_indexTranslationUnit(QuantumBinding.Clang.Interop.CXIndexAction param0, QuantumBinding.Clang.Interop.CXClientData client_data, QuantumBinding.Clang.Interop.IndexerCallbacks* index_callbacks, uint index_callbacks_size, uint index_options, QuantumBinding.Clang.Interop.CXTranslationUnitImpl param5); /// /// Returns text of the specified argument. @@ -1876,7 +1876,7 @@ public static unsafe partial class ClangInterop /// Determine whether the given header is guarded against multiple inclusions, either with the conventional #ifndef/#define/#endif macro guards or with #pragma once. /// [DllImport(LibraryPath, EntryPoint = "clang_isFileMultipleIncludeGuarded", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_isFileMultipleIncludeGuarded(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFileImpl file); + internal static extern uint clang_isFileMultipleIncludeGuarded(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFile file); /// /// Return 1 if the CXType is a variadic function type, and 0 otherwise. @@ -1954,7 +1954,7 @@ public static unsafe partial class ClangInterop /// Deserialize a set of diagnostics from a Clang diagnostics bitcode file. /// [DllImport(LibraryPath, EntryPoint = "clang_loadDiagnostics", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXDiagnosticSetImpl clang_loadDiagnostics(sbyte* file, out CXLoadDiag_Error error, out QuantumBinding.Clang.Interop.CXString errorString); + internal static extern CXDiagnosticSet clang_loadDiagnostics(sbyte* file, CXLoadDiag_Error* error, QuantumBinding.Clang.Interop.CXString* errorString); /// /// Returns non-zero if the given source location is in the main file of the corresponding translation unit. @@ -1972,43 +1972,43 @@ public static unsafe partial class ClangInterop /// Returns the module file where the provided module object came from. /// [DllImport(LibraryPath, EntryPoint = "clang_Module_getASTFile", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXFileImpl clang_Module_getASTFile(QuantumBinding.Clang.Interop.CXModuleImpl module); + internal static extern CXFile clang_Module_getASTFile(QuantumBinding.Clang.Interop.CXModule module); /// /// Returns the full name of the module, e.g. "std.vector". /// [DllImport(LibraryPath, EntryPoint = "clang_Module_getFullName", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_Module_getFullName(QuantumBinding.Clang.Interop.CXModuleImpl module); + internal static extern CXString clang_Module_getFullName(QuantumBinding.Clang.Interop.CXModule module); /// /// Returns the name of the module, e.g. for the 'std.vector' sub-module it will return "vector". /// [DllImport(LibraryPath, EntryPoint = "clang_Module_getName", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_Module_getName(QuantumBinding.Clang.Interop.CXModuleImpl module); + internal static extern CXString clang_Module_getName(QuantumBinding.Clang.Interop.CXModule module); /// /// Returns the number of top level headers associated with this module. /// [DllImport(LibraryPath, EntryPoint = "clang_Module_getNumTopLevelHeaders", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_Module_getNumTopLevelHeaders(QuantumBinding.Clang.Interop.CXTranslationUnitImpl param0, QuantumBinding.Clang.Interop.CXModuleImpl module); + internal static extern uint clang_Module_getNumTopLevelHeaders(QuantumBinding.Clang.Interop.CXTranslationUnitImpl param0, QuantumBinding.Clang.Interop.CXModule module); /// /// Returns the parent of a sub-module or NULL if the given module is top-level, e.g. for 'std.vector' it will return the 'std' module. /// [DllImport(LibraryPath, EntryPoint = "clang_Module_getParent", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXModuleImpl clang_Module_getParent(QuantumBinding.Clang.Interop.CXModuleImpl module); + internal static extern CXModule clang_Module_getParent(QuantumBinding.Clang.Interop.CXModule module); /// /// Returns the specified top level header associated with the module. /// [DllImport(LibraryPath, EntryPoint = "clang_Module_getTopLevelHeader", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXFileImpl clang_Module_getTopLevelHeader(QuantumBinding.Clang.Interop.CXTranslationUnitImpl param0, QuantumBinding.Clang.Interop.CXModuleImpl module, uint index); + internal static extern CXFile clang_Module_getTopLevelHeader(QuantumBinding.Clang.Interop.CXTranslationUnitImpl param0, QuantumBinding.Clang.Interop.CXModule module, uint index); /// /// Returns non-zero if the module is a system one. /// [DllImport(LibraryPath, EntryPoint = "clang_Module_isSystem", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern int clang_Module_isSystem(QuantumBinding.Clang.Interop.CXModuleImpl module); + internal static extern int clang_Module_isSystem(QuantumBinding.Clang.Interop.CXModule module); /// /// Prune module files in the module cache directory that haven't been accessed in a long time. @@ -2080,37 +2080,37 @@ public static unsafe partial class ClangInterop /// Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit instead of an error code. In case of an error this routine returns a NULL CXTranslationUnit, without further detailed error codes. /// [DllImport(LibraryPath, EntryPoint = "clang_parseTranslationUnit", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXTranslationUnitImpl clang_parseTranslationUnit(QuantumBinding.Clang.Interop.CXIndexImpl cIdx, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, uint options); + internal static extern CXTranslationUnitImpl clang_parseTranslationUnit(QuantumBinding.Clang.Interop.CXIndex cIdx, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, uint options); /// /// Parse the given source file and the translation unit corresponding to that file. /// [DllImport(LibraryPath, EntryPoint = "clang_parseTranslationUnit2", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXErrorCode clang_parseTranslationUnit2(QuantumBinding.Clang.Interop.CXIndexImpl cIdx, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, uint options, out QuantumBinding.Clang.Interop.CXTranslationUnitImpl out_TU); + internal static extern CXErrorCode clang_parseTranslationUnit2(QuantumBinding.Clang.Interop.CXIndex cIdx, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, uint options, QuantumBinding.Clang.Interop.CXTranslationUnitImpl* out_TU); /// /// Same as clang_parseTranslationUnit2 but requires a full command line for command_line_args including argv[0]. This is useful if the standard library paths are relative to the binary. /// [DllImport(LibraryPath, EntryPoint = "clang_parseTranslationUnit2FullArgv", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXErrorCode clang_parseTranslationUnit2FullArgv(QuantumBinding.Clang.Interop.CXIndexImpl cIdx, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, uint options, out QuantumBinding.Clang.Interop.CXTranslationUnitImpl out_TU); + internal static extern CXErrorCode clang_parseTranslationUnit2FullArgv(QuantumBinding.Clang.Interop.CXIndex cIdx, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, uint options, QuantumBinding.Clang.Interop.CXTranslationUnitImpl* out_TU); /// /// Release a printing policy. /// [DllImport(LibraryPath, EntryPoint = "clang_PrintingPolicy_dispose", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_PrintingPolicy_dispose(QuantumBinding.Clang.Interop.CXPrintingPolicyImpl policy); + internal static extern void clang_PrintingPolicy_dispose(QuantumBinding.Clang.Interop.CXPrintingPolicy policy); /// /// Get a property value for the given printing policy. /// [DllImport(LibraryPath, EntryPoint = "clang_PrintingPolicy_getProperty", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_PrintingPolicy_getProperty(QuantumBinding.Clang.Interop.CXPrintingPolicyImpl policy, CXPrintingPolicyProperty property); + internal static extern uint clang_PrintingPolicy_getProperty(QuantumBinding.Clang.Interop.CXPrintingPolicy policy, CXPrintingPolicyProperty property); /// /// Set a property value for the given printing policy. /// [DllImport(LibraryPath, EntryPoint = "clang_PrintingPolicy_setProperty", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_PrintingPolicy_setProperty(QuantumBinding.Clang.Interop.CXPrintingPolicyImpl policy, CXPrintingPolicyProperty property, uint value); + internal static extern void clang_PrintingPolicy_setProperty(QuantumBinding.Clang.Interop.CXPrintingPolicy policy, CXPrintingPolicyProperty property, uint value); /// /// Returns non-zero if range is null. @@ -2119,13 +2119,13 @@ public static unsafe partial class ClangInterop internal static extern int clang_Range_isNull(QuantumBinding.Clang.Interop.CXSourceRange range); [DllImport(LibraryPath, EntryPoint = "clang_remap_dispose", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_remap_dispose(QuantumBinding.Clang.Interop.CXRemappingImpl param0); + internal static extern void clang_remap_dispose(QuantumBinding.Clang.Interop.CXRemapping param0); [DllImport(LibraryPath, EntryPoint = "clang_remap_getFilenames", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_remap_getFilenames(QuantumBinding.Clang.Interop.CXRemappingImpl param0, uint param1, QuantumBinding.Clang.Interop.CXString* param2, QuantumBinding.Clang.Interop.CXString* param3); + internal static extern void clang_remap_getFilenames(QuantumBinding.Clang.Interop.CXRemapping param0, uint param1, QuantumBinding.Clang.Interop.CXString* param2, QuantumBinding.Clang.Interop.CXString* param3); [DllImport(LibraryPath, EntryPoint = "clang_remap_getNumFiles", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_remap_getNumFiles(QuantumBinding.Clang.Interop.CXRemappingImpl param0); + internal static extern uint clang_remap_getNumFiles(QuantumBinding.Clang.Interop.CXRemapping param0); /// /// Reparse the source files that produced this translation unit. @@ -2323,7 +2323,7 @@ public static unsafe partial class ClangInterop /// Visit the fields of a particular type. /// [DllImport(LibraryPath, EntryPoint = "clang_Type_visitFields", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_Type_visitFields(QuantumBinding.Clang.Interop.CXType t, nuint visitor, QuantumBinding.Clang.Interop.CXClientDataImpl client_data); + internal static extern uint clang_Type_visitFields(QuantumBinding.Clang.Interop.CXType t, nuint visitor, QuantumBinding.Clang.Interop.CXClientData client_data); /// /// Returns text contained in the AST node. @@ -2371,7 +2371,7 @@ public static unsafe partial class ClangInterop /// Visit the children of a particular cursor. /// [DllImport(LibraryPath, EntryPoint = "clang_visitChildren", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_visitChildren(QuantumBinding.Clang.Interop.CXCursor parent, nuint visitor, QuantumBinding.Clang.Interop.CXClientDataImpl client_data); + internal static extern uint clang_visitChildren(QuantumBinding.Clang.Interop.CXCursor parent, nuint visitor, QuantumBinding.Clang.Interop.CXClientData client_data); /// /// Visits the children of a cursor using the specified block. Behaves identically to clang_visitChildren() in all other respects. @@ -2383,13 +2383,13 @@ public static unsafe partial class ClangInterop /// Visit the base classes of a type. /// [DllImport(LibraryPath, EntryPoint = "clang_visitCXXBaseClasses", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_visitCXXBaseClasses(QuantumBinding.Clang.Interop.CXType t, nuint visitor, QuantumBinding.Clang.Interop.CXClientDataImpl client_data); + internal static extern uint clang_visitCXXBaseClasses(QuantumBinding.Clang.Interop.CXType t, nuint visitor, QuantumBinding.Clang.Interop.CXClientData client_data); /// /// Visit the class methods of a type. /// [DllImport(LibraryPath, EntryPoint = "clang_visitCXXMethods", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_visitCXXMethods(QuantumBinding.Clang.Interop.CXType t, nuint visitor, QuantumBinding.Clang.Interop.CXClientDataImpl client_data); + internal static extern uint clang_visitCXXMethods(QuantumBinding.Clang.Interop.CXType t, nuint visitor, QuantumBinding.Clang.Interop.CXClientData client_data); } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/OldFashionDelegates/OldFashionDelegates.cs b/QuantumBinding.ClangPlayground/Generated/Interop/OldFashionDelegates/OldFashionDelegates.cs index ecd6ffa..858d1f5 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/OldFashionDelegates/OldFashionDelegates.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/OldFashionDelegates/OldFashionDelegates.cs @@ -18,17 +18,17 @@ public static unsafe class Delegates /// Visitor invoked for each cursor found by a traversal. /// [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate CXChildVisitResult CXCursorVisitor(QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXCursor parent, QuantumBinding.Clang.Interop.CXClientDataImpl client_data); + public unsafe delegate CXChildVisitResult CXCursorVisitor(QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXCursor parent, QuantumBinding.Clang.Interop.CXClientData client_data); /// /// Visitor invoked for each file in a translation unit (used with clang_getInclusions()). /// [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void CXInclusionVisitor(QuantumBinding.Clang.Interop.CXFileImpl included_file, QuantumBinding.Clang.Interop.CXSourceLocation* inclusion_stack, uint include_len, QuantumBinding.Clang.Interop.CXClientDataImpl client_data); + public unsafe delegate void CXInclusionVisitor(QuantumBinding.Clang.Interop.CXFile included_file, QuantumBinding.Clang.Interop.CXSourceLocation* inclusion_stack, uint include_len, QuantumBinding.Clang.Interop.CXClientData client_data); /// /// Visitor invoked for each field found by a traversal. /// [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate CXVisitorResult CXFieldVisitor(QuantumBinding.Clang.Interop.CXCursor C, QuantumBinding.Clang.Interop.CXClientDataImpl client_data); + public unsafe delegate CXVisitorResult CXFieldVisitor(QuantumBinding.Clang.Interop.CXCursor C, QuantumBinding.Clang.Interop.CXClientData client_data); } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXAPISetImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXAPISetImpl.cs index 34fb5da..3d7a266 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXAPISetImpl.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXAPISetImpl.cs @@ -14,7 +14,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXAPISetImpl { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXClientData.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXClientData.cs new file mode 100644 index 0000000..fbe8cf3 --- /dev/null +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXClientData.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// Opaque pointer representing client data that will be passed through to various callbacks and visitors. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXClientData +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXComment.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXComment.cs index c16c4e3..b6724c9 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXComment.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXComment.cs @@ -18,7 +18,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXComment { - public nuint aSTNode; + public void* aSTNode; public CXTranslationUnitImpl translationUnit; } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCompletionResult.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCompletionResult.cs index df5ff2e..9727769 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCompletionResult.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCompletionResult.cs @@ -25,7 +25,7 @@ public unsafe partial struct CXCompletionResult /// /// The code-completion string that describes how to insert this code-completion result into the editing buffer. /// - public CXCompletionStringImpl completionString; + public CXCompletionString completionString; } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCompletionString.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCompletionString.cs new file mode 100644 index 0000000..29d6e31 --- /dev/null +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCompletionString.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// A semantic string that describes a code-completion result. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXCompletionString +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCursorAndRangeVisitor.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCursorAndRangeVisitor.cs index 5cbb4a1..ac93a8c 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCursorAndRangeVisitor.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCursorAndRangeVisitor.cs @@ -8,15 +8,14 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using QuantumBinding.Clang; namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXCursorAndRangeVisitor { - public nuint context; - public nuint visit; + public void* context; + public void* visit; } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCursorSetImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCursorSetImpl.cs index 7f90e72..065c72a 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCursorSetImpl.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCursorSetImpl.cs @@ -14,7 +14,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXCursorSetImpl { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXDiagnostic.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXDiagnostic.cs new file mode 100644 index 0000000..495befe --- /dev/null +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXDiagnostic.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// A single diagnostic, containing the diagnostic's severity, location, text, source ranges, and fix-it hints. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXDiagnostic +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXClientDataImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXDiagnosticSet.cs similarity index 81% rename from QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXClientDataImpl.cs rename to QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXDiagnosticSet.cs index 472979e..7fb65a5 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXClientDataImpl.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXDiagnosticSet.cs @@ -11,10 +11,13 @@ namespace QuantumBinding.Clang.Interop; +/// +/// A group of CXDiagnostics. +/// [StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXClientDataImpl +public unsafe partial struct CXDiagnosticSet { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCompletionStringImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXEvalResult.cs similarity index 81% rename from QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCompletionStringImpl.cs rename to QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXEvalResult.cs index 55ec3f8..396b6aa 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXCompletionStringImpl.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXEvalResult.cs @@ -11,10 +11,13 @@ namespace QuantumBinding.Clang.Interop; +/// +/// Evaluation result of a cursor +/// [StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXCompletionStringImpl +public unsafe partial struct CXEvalResult { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXEvalResultImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXEvalResultImpl.cs deleted file mode 100644 index 8f2c207..0000000 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXEvalResultImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXEvalResultImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXDiagnosticImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXFile.cs similarity index 78% rename from QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXDiagnosticImpl.cs rename to QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXFile.cs index 6422451..5e6bdf3 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXDiagnosticImpl.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXFile.cs @@ -11,10 +11,13 @@ namespace QuantumBinding.Clang.Interop; +/// +/// A particular source file that is part of a translation unit. +/// [StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXDiagnosticImpl +public unsafe partial struct CXFile { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXFileImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXFileImpl.cs deleted file mode 100644 index b5d78fe..0000000 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXFileImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXFileImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientASTFile.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientASTFile.cs new file mode 100644 index 0000000..4f78068 --- /dev/null +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientASTFile.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// The client's data object that is associated with an AST file (PCH or module). +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXIdxClientASTFile +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientASTFileImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientASTFileImpl.cs deleted file mode 100644 index 105c9c3..0000000 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientASTFileImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXIdxClientASTFileImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientContainer.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientContainer.cs new file mode 100644 index 0000000..7312199 --- /dev/null +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientContainer.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// The client's data object that is associated with a semantic container of entities. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXIdxClientContainer +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientContainerImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientContainerImpl.cs deleted file mode 100644 index a6a717e..0000000 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientContainerImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXIdxClientContainerImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientEntity.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientEntity.cs new file mode 100644 index 0000000..83ca69d --- /dev/null +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientEntity.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// The client's data object that is associated with a semantic entity. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXIdxClientEntity +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientEntityImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientEntityImpl.cs deleted file mode 100644 index 2a5ee8b..0000000 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientEntityImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXIdxClientEntityImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXDiagnosticSetImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientFile.cs similarity index 78% rename from QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXDiagnosticSetImpl.cs rename to QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientFile.cs index ec89fb7..d9fcb1c 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXDiagnosticSetImpl.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientFile.cs @@ -11,10 +11,13 @@ namespace QuantumBinding.Clang.Interop; +/// +/// The client's data object that is associated with a CXFile. +/// [StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXDiagnosticSetImpl +public unsafe partial struct CXIdxClientFile { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientFileImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientFileImpl.cs deleted file mode 100644 index 01387e4..0000000 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxClientFileImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXIdxClientFileImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxImportedASTFileInfo.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxImportedASTFileInfo.cs index 6c0221b..789f6fd 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxImportedASTFileInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxImportedASTFileInfo.cs @@ -8,7 +8,6 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using QuantumBinding.Clang; namespace QuantumBinding.Clang.Interop; @@ -21,11 +20,11 @@ public unsafe partial struct CXIdxImportedASTFileInfo /// /// Top level AST file containing the imported PCH, module or submodule. /// - public CXFileImpl file; + public CXFile file; /// /// The imported module or NULL if the AST file is a PCH. /// - public CXModuleImpl module; + public CXModule module; /// /// Location where the file is imported. Applicable only for modules. /// diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxIncludedFileInfo.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxIncludedFileInfo.cs index 6438dbe..315f3d5 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxIncludedFileInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIdxIncludedFileInfo.cs @@ -8,7 +8,6 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using QuantumBinding.Clang; namespace QuantumBinding.Clang.Interop; @@ -29,7 +28,7 @@ public unsafe partial struct CXIdxIncludedFileInfo /// /// The actual file that the #include/#import directive resolved to. /// - public CXFileImpl file; + public CXFile file; public int isImport; public int isAngled; /// diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIndex.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIndex.cs new file mode 100644 index 0000000..6a47649 --- /dev/null +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIndex.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// An "index" that consists of a set of translation units that would typically be linked together into an executable or library. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXIndex +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIndexAction.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIndexAction.cs new file mode 100644 index 0000000..4f137cd --- /dev/null +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIndexAction.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// An indexing action/session, to be applied to one or multiple translation units. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXIndexAction +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIndexActionImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIndexActionImpl.cs deleted file mode 100644 index 47f51ad..0000000 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIndexActionImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXIndexActionImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIndexImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIndexImpl.cs deleted file mode 100644 index 2624b66..0000000 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXIndexImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXIndexImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXModule.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXModule.cs new file mode 100644 index 0000000..02774f1 --- /dev/null +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXModule.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// The functions in this group provide access to information about modules. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXModule +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXModuleImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXModuleImpl.cs deleted file mode 100644 index 7715bf4..0000000 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXModuleImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXModuleImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXModuleMapDescriptorImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXModuleMapDescriptorImpl.cs index 671db06..c116557 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXModuleMapDescriptorImpl.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXModuleMapDescriptorImpl.cs @@ -14,7 +14,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXModuleMapDescriptorImpl { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXPrintingPolicy.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXPrintingPolicy.cs new file mode 100644 index 0000000..aece309 --- /dev/null +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXPrintingPolicy.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// Opaque pointer representing a policy that controls pretty printing for clang_getCursorPrettyPrinted. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXPrintingPolicy +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXPrintingPolicyImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXPrintingPolicyImpl.cs deleted file mode 100644 index 5db69c5..0000000 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXPrintingPolicyImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXPrintingPolicyImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXRemapping.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXRemapping.cs new file mode 100644 index 0000000..cd9051f --- /dev/null +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXRemapping.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// CINDEX_DEPRECATED - disabled to silence MSVC deprecation warnings +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXRemapping +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXRemappingImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXRemappingImpl.cs deleted file mode 100644 index a35ccc7..0000000 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXRemappingImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXRemappingImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXString.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXString.cs index ab6fe99..85eb145 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXString.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXString.cs @@ -17,7 +17,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXString { - public nuint data; + public void* data; public uint private_flags; } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXTUResourceUsage.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXTUResourceUsage.cs index 4c279bc..e0ccc5a 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXTUResourceUsage.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXTUResourceUsage.cs @@ -20,7 +20,7 @@ public unsafe partial struct CXTUResourceUsage /// /// Private data member, used for queries. /// - public nuint data; + public void* data; /// /// The number of entries in the 'entries' array. /// diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXTargetInfoImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXTargetInfoImpl.cs index 9f8d33d..62df09b 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXTargetInfoImpl.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXTargetInfoImpl.cs @@ -14,7 +14,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXTargetInfoImpl { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXToken.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXToken.cs index c0487be..e10e346 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXToken.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXToken.cs @@ -18,7 +18,7 @@ namespace QuantumBinding.Clang.Interop; public unsafe partial struct CXToken { public unsafe fixed uint int_data[4]; - public nuint ptr_data; + public void* ptr_data; } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXTranslationUnitImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXTranslationUnitImpl.cs index 1ab6d0f..985890f 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXTranslationUnitImpl.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXTranslationUnitImpl.cs @@ -14,7 +14,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXTranslationUnitImpl { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXVirtualFileOverlayImpl.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXVirtualFileOverlayImpl.cs index 006b0d0..a1a7cb0 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXVirtualFileOverlayImpl.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/CXVirtualFileOverlayImpl.cs @@ -14,7 +14,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXVirtualFileOverlayImpl { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/IndexerCallbacks.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/IndexerCallbacks.cs index c191330..33277f3 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/IndexerCallbacks.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/IndexerCallbacks.cs @@ -8,7 +8,6 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using QuantumBinding.Clang; namespace QuantumBinding.Clang.Interop; @@ -21,29 +20,29 @@ public unsafe partial struct IndexerCallbacks /// /// Called periodically to check whether indexing should be aborted. Should return 0 to continue, and non-zero to abort. /// - public nuint abortQuery; + public delegate* unmanaged abortQuery; /// /// Called at the end of indexing; passes the complete diagnostic set. /// - public nuint diagnostic; - public nuint enteredMainFile; + public delegate* unmanaged diagnostic; + public delegate* unmanaged enteredMainFile; /// /// Called when a file gets #included/#imported. /// - public nuint ppIncludedFile; + public delegate* unmanaged ppIncludedFile; /// /// Called when a AST file (PCH or module) gets imported. /// - public nuint importedASTFile; + public delegate* unmanaged importedASTFile; /// /// Called at the beginning of indexing a translation unit. /// - public nuint startedTranslationUnit; - public nuint indexDeclaration; + public delegate* unmanaged startedTranslationUnit; + public delegate* unmanaged indexDeclaration; /// /// Called to index a reference of an entity. /// - public nuint indexEntityReference; + public delegate* unmanaged indexEntityReference; } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/_CXChildVisitResult.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/_CXChildVisitResult.cs index 108c93f..4a2eb26 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/_CXChildVisitResult.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/_CXChildVisitResult.cs @@ -14,7 +14,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct _CXChildVisitResult { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/_CXCursorAndRangeVisitorBlock.cs b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/_CXCursorAndRangeVisitorBlock.cs index 7f66b6b..c0028c4 100644 --- a/QuantumBinding.ClangPlayground/Generated/Interop/Structs/_CXCursorAndRangeVisitorBlock.cs +++ b/QuantumBinding.ClangPlayground/Generated/Interop/Structs/_CXCursorAndRangeVisitorBlock.cs @@ -14,7 +14,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct _CXCursorAndRangeVisitorBlock { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.ClangPlayground/Generated/StaticMethods/QuantumBinding.Clang.StaticMethods.cs b/QuantumBinding.ClangPlayground/Generated/StaticMethods/QuantumBinding.Clang.StaticMethods.cs index a75fc87..3769f37 100644 --- a/QuantumBinding.ClangPlayground/Generated/StaticMethods/QuantumBinding.Clang.StaticMethods.cs +++ b/QuantumBinding.ClangPlayground/Generated/StaticMethods/QuantumBinding.Clang.StaticMethods.cs @@ -36,7 +36,9 @@ public static QBVirtualFileOverlay VirtualFileOverlay_create(uint options) /// public static void Free(ref nuint buffer) { - QuantumBinding.Clang.Interop.ClangInterop.clang_free(buffer); + var arg0 = (void*)buffer; + QuantumBinding.Clang.Interop.ClangInterop.clang_free(arg0); + buffer = (nuint)arg0; } /// @@ -112,8 +114,15 @@ int CalculateSize(string file) { ref System.Span currentCursor = ref mainBuffer; var arg0 = QuantumBinding.Utils.MarshalContextUtils.MarshalString(file, ref currentCursor); - QuantumBinding.Clang.Interop.CXString arg2; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_loadDiagnostics(arg0, out error, out arg2); + var arg1 = stackalloc QuantumBinding.Clang.CXLoadDiag_Error[1]; + QuantumBinding.Clang.Interop.CXString arg2 = default; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_loadDiagnostics(arg0, arg1, &arg2); + if (arg1 is not null) + { + error = *arg1; + } + else + error = default; errorString = new QBString(arg2); return result; } @@ -491,7 +500,10 @@ public static void EnableStackTraces() public static void ExecuteOnThread(nuint fn, ref nuint user_data, uint stack_size) { - QuantumBinding.Clang.Interop.ClangInterop.clang_executeOnThread(fn, user_data, stack_size); + var arg0 = (void*)fn; + var arg1 = (void*)user_data; + QuantumBinding.Clang.Interop.ClangInterop.clang_executeOnThread(arg0, arg1, stack_size); + user_data = (nuint)arg1; } /// @@ -1041,7 +1053,7 @@ int CalculateSize(QBIdxContainerInfo param0) { ref System.Span currentCursor = ref mainBuffer; var arg0 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(param0, ref currentCursor); - var arg1 = param1 == null ? new CXIdxClientContainerImpl() : (CXIdxClientContainerImpl)param1; + var arg1 = param1 == null ? new CXIdxClientContainer() : (CXIdxClientContainer)param1; QuantumBinding.Clang.Interop.ClangInterop.clang_index_setClientContainer(arg0, arg1); } finally @@ -1100,7 +1112,7 @@ int CalculateSize(QBIdxEntityInfo param0) { ref System.Span currentCursor = ref mainBuffer; var arg0 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(param0, ref currentCursor); - var arg1 = param1 == null ? new CXIdxClientEntityImpl() : (CXIdxClientEntityImpl)param1; + var arg1 = param1 == null ? new CXIdxClientEntity() : (CXIdxClientEntity)param1; QuantumBinding.Clang.Interop.ClangInterop.clang_index_setClientEntity(arg0, arg1); } finally diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/IndexerCallbacks.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/IndexerCallbacks.cs index 8e1e2a4..f0441f6 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/IndexerCallbacks.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/IndexerCallbacks.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// A group of callbacks used by #clang_indexSourceFile and #clang_indexTranslationUnit. +/// public unsafe partial class IndexerCallbacks : IMarshallableObject, IMarshallable { public IndexerCallbacks() @@ -23,14 +26,14 @@ public IndexerCallbacks(in QuantumBinding.Clang.Interop.IndexerCallbacks native) MarshalFrom(in native); } - public nuint AbortQuery { get; set; } - public nuint Diagnostic { get; set; } - public nuint EnteredMainFile { get; set; } - public nuint PIncludedFile { get; set; } - public nuint ImportedASTFile { get; set; } - public nuint StartedTranslationUnit { get; set; } - public nuint IndexDeclaration { get; set; } - public nuint IndexEntityReference { get; set; } + public delegate* unmanaged AbortQuery { get; set; } + public delegate* unmanaged Diagnostic { get; set; } + public delegate* unmanaged EnteredMainFile { get; set; } + public delegate* unmanaged PIncludedFile { get; set; } + public delegate* unmanaged ImportedASTFile { get; set; } + public delegate* unmanaged StartedTranslationUnit { get; set; } + public delegate* unmanaged IndexDeclaration { get; set; } + public delegate* unmanaged IndexEntityReference { get; set; } public static implicit operator IndexerCallbacks(QuantumBinding.Clang.Interop.IndexerCallbacks i) { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCodeCompleteResults.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCodeCompleteResults.cs index 785714f..a78b9d7 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCodeCompleteResults.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCodeCompleteResults.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Contains the results of code-completion. +/// public unsafe partial class QBCodeCompleteResults : IMarshallableObject, IMarshallable { public QBCodeCompleteResults() diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBComment.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBComment.cs index cf737a0..d3a3c4e 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBComment.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBComment.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// A parsed comment. +/// public unsafe partial class QBComment : IMarshallableObject, IMarshallable { public QBComment() @@ -374,7 +377,7 @@ public void MarshalTo(ref MarshallingContext context) { - context.Destination[0].aSTNode = qBComment.ASTNode; + if (qBComment.ASTNode != default) + { + context.Destination[0].aSTNode = (void*)qBComment.ASTNode; + } if (qBComment.TranslationUnit != default) { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCompletionResult.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCompletionResult.cs index 092a6e7..d883c59 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCompletionResult.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCompletionResult.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// A single result of code completion. +/// public unsafe partial class QBCompletionResult : IMarshallableObject, IMarshallable { public QBCompletionResult() @@ -63,10 +66,7 @@ public CXCompletionResultMarshaller(QuantumBinding.Clang.QBCompletionResult qBCo { context.Destination[0].cursorKind = qBCompletionResult.CursorKind; - if (qBCompletionResult.CompletionString != default) - { - context.Destination[0].completionString = qBCompletionResult.CompletionString; - } + context.Destination[0].completionString = qBCompletionResult.CompletionString; } } diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCursor.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCursor.cs index bb4408b..0e3a3de 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCursor.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCursor.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// A cursor representing some element in the abstract syntax tree for a translation unit. +/// public unsafe partial class QBCursor : IMarshallableObject, IMarshallable { public QBCursor() @@ -528,11 +531,7 @@ int CalculateSize(QBCursor c, QBString language, QBString definedIn) var arg0 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToNative(this, ref currentCursor); var arg1 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(language, ref currentCursor); var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(definedIn, ref currentCursor); - var arg3 = stackalloc uint[1]; - *arg3 = isGenerated; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_Cursor_isExternalSymbol(arg0, arg1, arg2, arg3); - isGenerated = *arg3; - return result; + return QuantumBinding.Clang.Interop.ClangInterop.clang_Cursor_isExternalSymbol(arg0, arg1, arg2, ref isGenerated); } finally { @@ -855,7 +854,7 @@ int CalculateSize(QBCursor cursor, QBCursorAndRangeVisitor visitor) { ref System.Span currentCursor = ref mainBuffer; var arg0 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToNative(this, ref currentCursor); - var arg1 = file == null ? new CXFileImpl() : (CXFileImpl)file; + var arg1 = file == null ? new CXFile() : (CXFile)file; var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToNative(visitor, ref currentCursor); return QuantumBinding.Clang.Interop.ClangInterop.clang_findReferencesInFile(arg0, arg1, arg2); } @@ -870,7 +869,7 @@ public CXResult FindReferencesInFileWithBlock(QuantumBinding.Clang.QBFile param1 { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - var arg1 = param1 == null ? new CXFileImpl() : (CXFileImpl)param1; + var arg1 = param1 == null ? new CXFile() : (CXFile)param1; var arg2 = param2 == null ? new _CXCursorAndRangeVisitorBlock() : (_CXCursorAndRangeVisitorBlock)param2; return QuantumBinding.Clang.Interop.ClangInterop.clang_findReferencesInFileWithBlock(native, arg1, arg2); } @@ -1039,17 +1038,13 @@ int CalculateSize(QBCursor cursor, QBString deprecated_message, QBString unavail var arg1 = stackalloc int[1]; *arg1 = always_deprecated; var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(deprecated_message, ref currentCursor); - var arg3 = stackalloc int[1]; - *arg3 = always_unavailable; var arg4 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(unavailable_message, ref currentCursor); QuantumBinding.Clang.Interop.CXPlatformAvailability* arg5 = null; if (!availability.IsEmpty) { arg5 = QuantumBinding.Utils.MarshalContextUtils.MarshalArrayOfWrappers(availability, ref currentCursor); } - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_getCursorPlatformAvailability(arg0, arg1, arg2, arg3, arg4, arg5, availability_size); - always_unavailable = *arg3; - return result; + return QuantumBinding.Clang.Interop.ClangInterop.clang_getCursorPlatformAvailability(arg0, arg1, arg2, ref always_unavailable, arg4, arg5, availability_size); } finally { @@ -1065,7 +1060,7 @@ public QBString GetCursorPrettyPrinted(QuantumBinding.Clang.QBPrintingPolicy pol { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - var arg1 = policy == null ? new CXPrintingPolicyImpl() : (CXPrintingPolicyImpl)policy; + var arg1 = policy == null ? new CXPrintingPolicy() : (CXPrintingPolicy)policy; return QuantumBinding.Clang.Interop.ClangInterop.clang_getCursorPrettyPrinted(native, arg1); } @@ -1220,19 +1215,7 @@ int CalculateSize(QBCursor param0, System.ReadOnlySpan startBuf, System. var arg0 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToNative(this, ref currentCursor); var arg1 = QuantumBinding.Utils.MarshalContextUtils.MarshalStringArray(startBuf, ref currentCursor); var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStringArray(endBuf, ref currentCursor); - var arg3 = stackalloc uint[1]; - *arg3 = startLine; - var arg4 = stackalloc uint[1]; - *arg4 = startColumn; - var arg5 = stackalloc uint[1]; - *arg5 = endLine; - var arg6 = stackalloc uint[1]; - *arg6 = endColumn; - QuantumBinding.Clang.Interop.ClangInterop.clang_getDefinitionSpellingAndExtent(arg0, arg1, arg2, arg3, arg4, arg5, arg6); - startLine = *arg3; - startColumn = *arg4; - endLine = *arg5; - endColumn = *arg6; + QuantumBinding.Clang.Interop.ClangInterop.clang_getDefinitionSpellingAndExtent(arg0, arg1, arg2, ref startLine, ref startColumn, ref endLine, ref endColumn); } finally { @@ -1360,7 +1343,7 @@ public void GetOverriddenCursors(out QBCursor[] overridden, out uint num_overrid { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - QuantumBinding.Clang.Interop.CXCursor* arg1 = null; + QuantumBinding.Clang.Interop.CXCursor* arg1 = default; QuantumBinding.Clang.Interop.ClangInterop.clang_getOverriddenCursors(native, arg1, out num_overridden); overridden = new QuantumBinding.Clang.QBCursor[num_overridden]; for (var i = 0U; i < num_overridden; ++i) @@ -1456,7 +1439,7 @@ public uint VisitChildren(nuint visitor, QuantumBinding.Clang.QBClientData clien { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - var arg2 = client_data == null ? new CXClientDataImpl() : (CXClientDataImpl)client_data; + var arg2 = client_data == null ? new CXClientData() : (CXClientData)client_data; return QuantumBinding.Clang.Interop.ClangInterop.clang_visitChildren(native, visitor, arg2); } diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCursorAndRangeVisitor.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCursorAndRangeVisitor.cs index 6e80799..4d285e5 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCursorAndRangeVisitor.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBCursorAndRangeVisitor.cs @@ -44,8 +44,8 @@ public void MarshalTo(ref MarshallingContext(ref TContext context) where TContext : IMarshallingContext, allows ref struct @@ -61,9 +61,15 @@ private ref struct CXCursorAndRangeVisitorMarshaller { public CXCursorAndRangeVisitorMarshaller(QuantumBinding.Clang.QBCursorAndRangeVisitor qBCursorAndRangeVisitor, ref QuantumBinding.Utils.MarshallingContext context) { - context.Destination[0].context = qBCursorAndRangeVisitor.Context; + if (qBCursorAndRangeVisitor.Context != default) + { + context.Destination[0].context = (void*)qBCursorAndRangeVisitor.Context; + } - context.Destination[0].visit = qBCursorAndRangeVisitor.Visit; + if (qBCursorAndRangeVisitor.Visit != default) + { + context.Destination[0].visit = (void*)qBCursorAndRangeVisitor.Visit; + } } } diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBFileUniqueID.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBFileUniqueID.cs index 8f3d32c..19a23aa 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBFileUniqueID.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBFileUniqueID.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Uniquely identifies a CXFile, that refers to the same underlying file, across an indexing session. +/// public unsafe partial class QBFileUniqueID : IMarshallableObject, IMarshallable { public QBFileUniqueID() @@ -44,7 +47,8 @@ public void MarshalTo(ref MarshallingContext +/// Data for IndexerCallbacks#indexEntityReference. +/// public unsafe partial class QBIdxEntityRefInfo : IMarshallableObject, IMarshallable { public QBIdxEntityRefInfo() diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxImportedASTFileInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxImportedASTFileInfo.cs index 7cb430c..59e4f91 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxImportedASTFileInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxImportedASTFileInfo.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Data for IndexerCallbacks#importedASTFile. +/// public unsafe partial class QBIdxImportedASTFileInfo : IMarshallableObject, IMarshallable { public QBIdxImportedASTFileInfo() @@ -65,15 +68,9 @@ private ref struct CXIdxImportedASTFileInfoMarshaller { public CXIdxImportedASTFileInfoMarshaller(QuantumBinding.Clang.QBIdxImportedASTFileInfo qBIdxImportedASTFileInfo, ref QuantumBinding.Utils.MarshallingContext context) { - if (qBIdxImportedASTFileInfo.File != default) - { - context.Destination[0].file = qBIdxImportedASTFileInfo.File; - } + context.Destination[0].file = qBIdxImportedASTFileInfo.File; - if (qBIdxImportedASTFileInfo.Module != default) - { - context.Destination[0].module = qBIdxImportedASTFileInfo.Module; - } + context.Destination[0].module = qBIdxImportedASTFileInfo.Module; if (qBIdxImportedASTFileInfo.Loc != default) { diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxIncludedFileInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxIncludedFileInfo.cs index 089f4a9..9a703ab 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxIncludedFileInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxIncludedFileInfo.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Data for ppIncludedFile callback. +/// public unsafe partial class QBIdxIncludedFileInfo : IMarshallableObject, IMarshallable { public QBIdxIncludedFileInfo() @@ -90,10 +93,7 @@ public CXIdxIncludedFileInfoMarshaller(QuantumBinding.Clang.QBIdxIncludedFileInf context.Destination[0].filename = (sbyte*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref System.Runtime.InteropServices.MemoryMarshal.GetReference(stringSpan)); } - if (qBIdxIncludedFileInfo.File != default) - { - context.Destination[0].file = qBIdxIncludedFileInfo.File; - } + context.Destination[0].file = qBIdxIncludedFileInfo.File; context.Destination[0].isImport = qBIdxIncludedFileInfo.IsImport; diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxLoc.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxLoc.cs index 3780d9c..58f3f29 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxLoc.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxLoc.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Source location passed to index callbacks. +/// public unsafe partial class QBIdxLoc : IMarshallableObject, IMarshallable { public QBIdxLoc() @@ -42,9 +45,9 @@ public void IndexLoc_getFileLocation(out QuantumBinding.Clang.QBIdxClientFile in { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - CXIdxClientFileImpl arg1; - CXFileImpl arg2; - QuantumBinding.Clang.Interop.ClangInterop.clang_indexLoc_getFileLocation(native, out arg1, out arg2, out line, out column, out offset); + CXIdxClientFile arg1 = default; + CXFile arg2 = default; + QuantumBinding.Clang.Interop.ClangInterop.clang_indexLoc_getFileLocation(native, &arg1, &arg2, out line, out column, out offset); indexFile = new QBIdxClientFile(arg1); file = new QBFile(arg2); } diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCProtocolRefListInfo.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCProtocolRefListInfo.cs index 472a3b7..343eec2 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCProtocolRefListInfo.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBIdxObjCProtocolRefListInfo.cs @@ -54,9 +54,10 @@ public void MarshalTo(ref MarshallingContext +/// Index initialization options. +/// public unsafe partial class QBIndexOptions : IMarshallableObject, IMarshallable { public QBIndexOptions() diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBPlatformAvailability.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBPlatformAvailability.cs index 54663b2..f5e1a2c 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBPlatformAvailability.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBPlatformAvailability.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Describes the availability of a given entity on a particular platform, e.g., a particular class might only be available on Mac OS 10.7 or newer. +/// public unsafe partial class QBPlatformAvailability : IMarshallableObject, IMarshallable { public QBPlatformAvailability() diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceLocation.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceLocation.cs index 8e7117c..3c88263 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceLocation.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceLocation.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Identifies a specific source location within a translation unit. +/// public unsafe partial class QBSourceLocation : IMarshallableObject, IMarshallable { public QBSourceLocation() @@ -64,8 +67,8 @@ public void GetExpansionLocation(out QuantumBinding.Clang.QBFile file, out uint { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - CXFileImpl arg1; - QuantumBinding.Clang.Interop.ClangInterop.clang_getExpansionLocation(native, out arg1, out line, out column, out offset); + CXFile arg1 = default; + QuantumBinding.Clang.Interop.ClangInterop.clang_getExpansionLocation(native, &arg1, out line, out column, out offset); file = new QBFile(arg1); } @@ -76,8 +79,8 @@ public void GetFileLocation(out QuantumBinding.Clang.QBFile file, out uint line, { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - CXFileImpl arg1; - QuantumBinding.Clang.Interop.ClangInterop.clang_getFileLocation(native, out arg1, out line, out column, out offset); + CXFile arg1 = default; + QuantumBinding.Clang.Interop.ClangInterop.clang_getFileLocation(native, &arg1, out line, out column, out offset); file = new QBFile(arg1); } @@ -88,8 +91,8 @@ public void GetInstantiationLocation(out QuantumBinding.Clang.QBFile file, out u { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - CXFileImpl arg1; - QuantumBinding.Clang.Interop.ClangInterop.clang_getInstantiationLocation(native, out arg1, out line, out column, out offset); + CXFile arg1 = default; + QuantumBinding.Clang.Interop.ClangInterop.clang_getInstantiationLocation(native, &arg1, out line, out column, out offset); file = new QBFile(arg1); } @@ -100,8 +103,8 @@ public void GetPresumedLocation(out QBString filename, out uint line, out uint c { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - QuantumBinding.Clang.Interop.CXString arg1; - QuantumBinding.Clang.Interop.ClangInterop.clang_getPresumedLocation(native, out arg1, out line, out column); + QuantumBinding.Clang.Interop.CXString arg1 = default; + QuantumBinding.Clang.Interop.ClangInterop.clang_getPresumedLocation(native, &arg1, out line, out column); filename = new QBString(arg1); } @@ -144,8 +147,8 @@ public void GetSpellingLocation(out QuantumBinding.Clang.QBFile file, out uint l { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - CXFileImpl arg1; - QuantumBinding.Clang.Interop.ClangInterop.clang_getSpellingLocation(native, out arg1, out line, out column, out offset); + CXFile arg1 = default; + QuantumBinding.Clang.Interop.ClangInterop.clang_getSpellingLocation(native, &arg1, out line, out column, out offset); file = new QBFile(arg1); } diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceRange.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceRange.cs index 9001e84..f428921 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceRange.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceRange.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Identifies a half-open character range in the source code. +/// public unsafe partial class QBSourceRange : IMarshallableObject, IMarshallable { public QBSourceRange() diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceRangeList.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceRangeList.cs index b7a9d45..f068cbf 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceRangeList.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBSourceRangeList.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Identifies an array of ranges. +/// public unsafe partial class QBSourceRangeList : IMarshallableObject, IMarshallable { public QBSourceRangeList() diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBString.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBString.cs index 7c54aa9..6b28a49 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBString.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBString.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// A character string. +/// public unsafe partial class QBString : IMarshallableObject, IMarshallable { public QBString() @@ -65,7 +68,7 @@ public void MarshalTo(ref MarshallingContext context) { - context.Destination[0].data = qBString.Data; + if (qBString.Data != default) + { + context.Destination[0].data = (void*)qBString.Data; + } context.Destination[0].private_flags = qBString.Private_flags; diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBTUResourceUsage.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBTUResourceUsage.cs index d6f06d5..711d0a7 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBTUResourceUsage.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBTUResourceUsage.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// The memory usage of a CXTranslationUnit, broken into categories. +/// public unsafe partial class QBTUResourceUsage : IMarshallableObject, IMarshallable { public QBTUResourceUsage() @@ -56,7 +59,7 @@ public void MarshalTo(ref MarshallingContext context) { - context.Destination[0].data = qBTUResourceUsage.Data; + if (qBTUResourceUsage.Data != default) + { + context.Destination[0].data = (void*)qBTUResourceUsage.Data; + } context.Destination[0].numEntries = qBTUResourceUsage.NumEntries; diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBToken.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBToken.cs index 739e40b..8604427 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBToken.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBToken.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Describes a single preprocessing token. +/// public unsafe partial class QBToken : IMarshallableObject, IMarshallable { public QBToken() @@ -55,10 +58,11 @@ public void MarshalTo(ref MarshallingContext(ref TContext context) where TContext : IMarshallingContext, allows ref struct @@ -80,7 +84,10 @@ public CXTokenMarshaller(QuantumBinding.Clang.QBToken qBToken, ref QuantumBindin QuantumBinding.Utils.MarshalingUtils.MarshalFixedArrayToPointer(qBToken.Int_data.Span, pDest, 4); } - context.Destination[0].ptr_data = qBToken.Ptr_data; + if (qBToken.Ptr_data != default) + { + context.Destination[0].ptr_data = (void*)qBToken.Ptr_data; + } } } diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBType.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBType.cs index 13112c0..dfe1c1b 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBType.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBType.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// The type of an element in the abstract syntax tree. +/// public unsafe partial class QBType : IMarshallableObject, IMarshallable { public QBType() @@ -134,7 +137,7 @@ public QBString GetFullyQualifiedName(QuantumBinding.Clang.QBPrintingPolicy poli { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - var arg1 = policy == null ? new CXPrintingPolicyImpl() : (CXPrintingPolicyImpl)policy; + var arg1 = policy == null ? new CXPrintingPolicy() : (CXPrintingPolicy)policy; return QuantumBinding.Clang.Interop.ClangInterop.clang_getFullyQualifiedName(native, arg1, withGlobalNsPrefix); } @@ -225,7 +228,7 @@ public QBString GetTypePrettyPrinted(QuantumBinding.Clang.QBPrintingPolicy cxPol { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - var arg1 = cxPolicy == null ? new CXPrintingPolicyImpl() : (CXPrintingPolicyImpl)cxPolicy; + var arg1 = cxPolicy == null ? new CXPrintingPolicy() : (CXPrintingPolicy)cxPolicy; return QuantumBinding.Clang.Interop.ClangInterop.clang_getTypePrettyPrinted(native, arg1); } @@ -508,7 +511,7 @@ public uint Type_visitFields(nuint visitor, QuantumBinding.Clang.QBClientData cl { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - var arg2 = client_data == null ? new CXClientDataImpl() : (CXClientDataImpl)client_data; + var arg2 = client_data == null ? new CXClientData() : (CXClientData)client_data; return QuantumBinding.Clang.Interop.ClangInterop.clang_Type_visitFields(native, visitor, arg2); } @@ -519,7 +522,7 @@ public uint VisitCXXBaseClasses(nuint visitor, QuantumBinding.Clang.QBClientData { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - var arg2 = client_data == null ? new CXClientDataImpl() : (CXClientDataImpl)client_data; + var arg2 = client_data == null ? new CXClientData() : (CXClientData)client_data; return QuantumBinding.Clang.Interop.ClangInterop.clang_visitCXXBaseClasses(native, visitor, arg2); } @@ -530,7 +533,7 @@ public uint VisitCXXMethods(nuint visitor, QuantumBinding.Clang.QBClientData cli { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - var arg2 = client_data == null ? new CXClientDataImpl() : (CXClientDataImpl)client_data; + var arg2 = client_data == null ? new CXClientData() : (CXClientData)client_data; return QuantumBinding.Clang.Interop.ClangInterop.clang_visitCXXMethods(native, visitor, arg2); } diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBUnsavedFile.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBUnsavedFile.cs index dd0806f..f2104f9 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBUnsavedFile.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBUnsavedFile.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Provides the contents of a file that has not yet been saved to disk. +/// public unsafe partial class QBUnsavedFile : IMarshallableObject, IMarshallable { public QBUnsavedFile() diff --git a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBVersion.cs b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBVersion.cs index c19ce3d..257b5a5 100644 --- a/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBVersion.cs +++ b/QuantumBinding.ClangPlayground/Generated/StructWrappers/QBVersion.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Describes a version number of the form major.minor.subminor. +/// public unsafe partial class QBVersion : IMarshallableObject, IMarshallable { public QBVersion() diff --git a/QuantumBinding.Demo/ClangBindingGenerator.cs b/QuantumBinding.Demo/ClangBindingGenerator.cs index 0e204c7..8a1690d 100755 --- a/QuantumBinding.Demo/ClangBindingGenerator.cs +++ b/QuantumBinding.Demo/ClangBindingGenerator.cs @@ -24,8 +24,8 @@ This file was autogenerated by {GeneratorName}. ----------------------------------------------------------------------------------------------"; var appRoot = AppContext.BaseDirectory.Substring(0, AppContext.BaseDirectory.LastIndexOf("bin")); - string outputPath = Path.GetFullPath(Path.Combine(appRoot, "..", "QuantumBinding.Clang", "Generated")); - //string outputPath = Path.GetFullPath(Path.Combine(appRoot, "..", "QuantumBinding.ClangPlayground", "Generated")); + //string outputPath = Path.GetFullPath(Path.Combine(appRoot, "..", "QuantumBinding.Clang", "Generated")); + string outputPath = Path.GetFullPath(Path.Combine(appRoot, "..", "QuantumBinding.ClangPlayground", "Generated")); string library = "libclang"; string interopSubNamespace = "Interop"; string mainNamespace = "QuantumBinding.Clang"; @@ -297,23 +297,23 @@ private void AddFunctionsToFix(ProcessingContext ctx) .WithField("visit") .InterpretAsPointerType(new BuiltinType(PrimitiveType.Void)); - api.Class("IndexerCallbacks") - .WithField("abortQuery") - .InterpretAsPointerType(new BuiltinType(PrimitiveType.Void)) - .WithField("diagnostic") - .InterpretAsPointerType(new BuiltinType(PrimitiveType.Void)) - .WithField("enteredMainFile") - .InterpretAsPointerType(new BuiltinType(PrimitiveType.Void)) - .WithField("ppIncludedFile") - .InterpretAsPointerType(new BuiltinType(PrimitiveType.Void)) - .WithField("importedASTFile") - .InterpretAsPointerType(new BuiltinType(PrimitiveType.Void)) - .WithField("startedTranslationUnit") - .InterpretAsPointerType(new BuiltinType(PrimitiveType.Void)) - .WithField("indexDeclaration") - .InterpretAsPointerType(new BuiltinType(PrimitiveType.Void)) - .WithField("indexEntityReference") - .InterpretAsPointerType(new BuiltinType(PrimitiveType.Void)); + // api.Class("IndexerCallbacks") + // .WithField("abortQuery") + // .InterpretAsPointerType(new BuiltinType(PrimitiveType.Void)) + // .WithField("diagnostic") + // .InterpretAsPointerType(new BuiltinType(PrimitiveType.Void)) + // .WithField("enteredMainFile") + // .InterpretAsPointerType(new BuiltinType(PrimitiveType.Void)) + // .WithField("ppIncludedFile") + // .InterpretAsPointerType(new BuiltinType(PrimitiveType.Void)) + // .WithField("importedASTFile") + // .InterpretAsPointerType(new BuiltinType(PrimitiveType.Void)) + // .WithField("startedTranslationUnit") + // .InterpretAsPointerType(new BuiltinType(PrimitiveType.Void)) + // .WithField("indexDeclaration") + // .InterpretAsPointerType(new BuiltinType(PrimitiveType.Void)) + // .WithField("indexEntityReference") + // .InterpretAsPointerType(new BuiltinType(PrimitiveType.Void)); api.Class("CXIdxEntityInfo") .WithField("attributes") diff --git a/QuantumBinding.Generator/AST/DeclarationUnit.cs b/QuantumBinding.Generator/AST/DeclarationUnit.cs index fe4f6e6..af18939 100755 --- a/QuantumBinding.Generator/AST/DeclarationUnit.cs +++ b/QuantumBinding.Generator/AST/DeclarationUnit.cs @@ -204,13 +204,6 @@ public void AddDeclaration(Declaration declaration) break; } break; - case Function function: - decl = Functions.FirstOrDefault(x => x.Name == declaration.Name); - break; - - case Delegate @delegate: - decl = Delegates.FirstOrDefault(x => x.Name == declaration.Name); - break; case GlobalUsings globalUsings: decl = GlobalUsings.FirstOrDefault(x => x.Name == declaration.Name); diff --git a/QuantumBinding.Generator/AST/Function.cs b/QuantumBinding.Generator/AST/Function.cs index f566bf3..b76a736 100755 --- a/QuantumBinding.Generator/AST/Function.cs +++ b/QuantumBinding.Generator/AST/Function.cs @@ -71,10 +71,6 @@ public override object Clone() Id = Id }; func.Parameters.AddRange(Parameters); - if (Comment != null) - { - func.Comment = (Comment) Comment.Clone(); - } return func; } diff --git a/QuantumBinding.Generator/AST/Parameter.cs b/QuantumBinding.Generator/AST/Parameter.cs index 2d00e3e..52f7988 100755 --- a/QuantumBinding.Generator/AST/Parameter.cs +++ b/QuantumBinding.Generator/AST/Parameter.cs @@ -14,21 +14,24 @@ public Parameter(string name) Name = name; } - public Parameter(Parameter parameter) + public Parameter(Parameter copy) { - ParameterKind = parameter.ParameterKind; - Type = parameter.Type.Clone() as BindingType; - WrappedType = parameter.WrappedType; - Name = parameter.Name; - Index = parameter.Index; - DefaultValue = parameter.DefaultValue; - Id = parameter.Id; + ParameterKind = copy.ParameterKind; + Type = copy.Type.Clone() as BindingType; + WrappedType = copy.WrappedType; + Name = copy.Name; + Index = copy.Index; + DefaultValue = copy.DefaultValue; + Id = copy.Id; Parent = Parent; - IsOverload = parameter.IsOverload; - IsOptional = parameter.IsOptional; + IsOverload = copy.IsOverload; + IsOptional = copy.IsOptional; + OriginalParameter = copy.OriginalParameter; } public bool IsOverload { get; set; } + + public Parameter OriginalParameter { get; set; } public Declaration Parent { get; set; } diff --git a/QuantumBinding.Generator/CSharpTypePrinter.cs b/QuantumBinding.Generator/CSharpTypePrinter.cs index ab7ca55..f4577ea 100755 --- a/QuantumBinding.Generator/CSharpTypePrinter.cs +++ b/QuantumBinding.Generator/CSharpTypePrinter.cs @@ -173,7 +173,7 @@ public override TypePrinterResult VisitPointerType(PointerType pointer) TypePrinterResult result = null; var depth = pointerDepth; - if (pointerDepth > 1 && Parameter is { ParameterKind: ParameterKind.Out }) + if (pointerDepth > 1 && Parameter is { ParameterKind: ParameterKind.Out } /*&& MarshalType != MarshalTypes.NativeParameter*/) { depth--; } @@ -241,9 +241,6 @@ public override TypePrinterResult VisitPointerType(PointerType pointer) break; case not null when pointer.IsPointerToClass(out var @classDecl) && @classDecl.NativeStruct != null: - // result = Parameter is { ParameterKind: ParameterKind.Out } - // ? Result(@classDecl.NativeStruct.Name) - // : Result(@classDecl.NativeStruct.Name, TextGenerator.GetPointerString(depth)); result = Result(@classDecl.NativeStruct.Name, TextGenerator.GetPointerString(depth)); break; default: @@ -317,12 +314,12 @@ public override TypePrinterResult VisitPointerType(PointerType pointer) { result = pointee.IsPointerToStructOrUnion() ? Result(printedResult.Type) - : Result(printedResult.Type, PointerOperator); + : Result(PrimitiveType.Nuint.GetDisplayName()); //Result(printedResult.Type, PointerOperator); } else { result = pointee.IsPointerToBuiltInType(out var primitive) - ? Result(printedResult.Type, TextGenerator.GetPointerString(pointerDepth)) + ? Result(PrimitiveType.Nuint.GetDisplayName())//Result(printedResult.Type, TextGenerator.GetPointerString(pointerDepth)) : Result(printedResult.Type); } } @@ -560,8 +557,18 @@ private TypePrinterResult VisitParameters(IEnumerable @params, bool i public override TypePrinterResult VisitParameter(Parameter parameter) { - PushParameter(parameter); - var hasModifier = ContainsModifiers(parameter, out var attribute, out var modifier); + Parameter currentParameter = parameter; + if (parameter.IsOverload && MarshalType == MarshalTypes.NativeFunctionCall) + { + currentParameter = parameter.OriginalParameter; + PushParameter(parameter.OriginalParameter); + } + else + { + PushParameter(currentParameter); + } + + var hasModifier = ContainsModifiers(currentParameter, out var attribute, out var modifier); TypePrinterResult result; switch (MarshalType) { @@ -573,9 +580,9 @@ public override TypePrinterResult VisitParameter(Parameter parameter) break; default: { - result = parameter.Type.Visit(this); + result = currentParameter.Type.Visit(this); - if (parameter.Type.Declaration is Class { IsSimpleType: false } decl) + if (currentParameter.Type.Declaration is Class { IsSimpleType: false } decl) { // Will always write full namespaces for structs and classes to avoid various collisions var fullTypeName = $"{decl.Namespace}.{result.Type}"; @@ -604,6 +611,12 @@ public override TypePrinterResult VisitParameter(Parameter parameter) } } + if (currentParameter.ParameterKind is ParameterKind.Out or ParameterKind.Ref && + currentParameter.Type.IsPointerToBuiltInType(out var prim)) + { + result.TypeSuffix = string.Empty; + } + // if (parameter.ParameterKind == ParameterKind.Out && // !parameter.Type.IsPointerToArray(out var arrayType, out var depthCount) && // !parameter.Type.IsPurePointer()) @@ -616,8 +629,8 @@ public override TypePrinterResult VisitParameter(Parameter parameter) result.ParameterName = string.Empty; } else if (MarshalType != MarshalTypes.DelegateType && - parameter.ParameterKind == ParameterKind.Ref - && !parameter.Type.IsPointer()) + currentParameter.ParameterKind == ParameterKind.Ref + && !currentParameter.Type.IsPointer()) { result.ParameterName = parameter.Name; } @@ -637,11 +650,11 @@ public override TypePrinterResult VisitParameter(Parameter parameter) if (Parameter.ParameterKind == ParameterKind.Ref) { - if (MarshalType is MarshalTypes.NativeParameter) + /*if (MarshalType is MarshalTypes.NativeParameter) { hasModifier = false; } - else if(parameter.Type.IsPointerToArray()) + else*/ if(currentParameter.Type.IsPointerToArray()) { hasModifier = false; } @@ -818,16 +831,28 @@ private bool ContainsModifiers(Parameter param, out string attribute, out string if (MarshalType is MarshalTypes.SkipParamModifiers) return false; - if (MarshalType is MarshalTypes.SkipParamTypes or MarshalTypes.DelegateType + if (MarshalType is MarshalTypes.NativeParameter + or MarshalTypes.SkipParamTypes + or MarshalTypes.DelegateType or MarshalTypes.DelegateParameter) { - // if (param.ParameterKind == ParameterKind.Ref && !(param.Type.IsPurePointer())) - // { - // modifier = "ref"; - // return true; - // } + uint depth = 0; + if (param.Type is PointerType pointerType) + { + depth = pointerType.GetDepth(); + } + + if (param.ParameterKind is ParameterKind.Ref or ParameterKind.Out && param.Type.IsPointerToBuiltInType(out var type)) + { + modifier = "ref"; + if (param.ParameterKind is ParameterKind.Out) + { + modifier = "out"; + } + return true; + } - if (param.ParameterKind == ParameterKind.Out && (param.Type.IsPointerToVoid(out var depth) && depth > 1)) + if (param.ParameterKind == ParameterKind.Out && /*(param.Type.IsPointerToVoid(out var depth) &&*/ depth > 1) { modifier = "out"; return true; @@ -859,13 +884,27 @@ private bool ContainsModifiers(Parameter param, out string attribute, out string } else if (MarshalType is MarshalTypes.NativeParameter or MarshalTypes.NativeFunctionCall) { + uint pointerDepth = 0; + if (param.Type is PointerType pointerType) + { + pointerDepth = pointerType.GetDepth(); + } switch (param.ParameterKind) { + case ParameterKind.Ref: + if (param.Type.IsPointerToBuiltInType(out var type)) + { + modifier = "ref"; + } + break; case ParameterKind.Out: - if (param.Type.IsPointerToVoid(out var depth) && depth > 1) + if (param.Type.IsPointerToBuiltInType(out var type1) + || param.Type.IsPointerToVoid(out var depth) && depth > 1 + || pointerDepth > 1) { modifier = "out"; } + break; } } diff --git a/QuantumBinding.Generator/CodeGeneration/MarshalContextToFunctionCodeGenerator.cs b/QuantumBinding.Generator/CodeGeneration/MarshalContextToFunctionCodeGenerator.cs index 6c9e1ec..be6e5e0 100644 --- a/QuantumBinding.Generator/CodeGeneration/MarshalContextToFunctionCodeGenerator.cs +++ b/QuantumBinding.Generator/CodeGeneration/MarshalContextToFunctionCodeGenerator.cs @@ -218,6 +218,11 @@ protected void MarshalSimpleType(Parameter parameter, string argumentName) else if (parameter.Type.IsPointerToBuiltInType(out var prim) && !parameter.Type.IsPurePointer()) { WritePointerToPrimitiveType(parameter, argumentName); + if (parameter.ParameterKind is ParameterKind.Out or ParameterKind.Ref && !parameter.IsOverload) + { + argumentName = parameter.Name; + } + CreateNativeParameter(parameter, argumentName, null); } // The input parameter is void*, so we need to just pass it as is without any conversion @@ -624,7 +629,14 @@ protected void MarshalPointerToStruct(Parameter parameter, string argumentName, ptrDepth--; WriteLine($"{nativeType}{GetPointerString(ptrDepth)} {argumentName} = {Default};"); PostActions.Enqueue(() => ConvertOutStructToClass(parameter, argumentName, classDecl)); - CreateNativeParameter(parameter, $"&{argumentName}", classDecl); + if (ptrDepth >= 1) + { + CreateNativeParameter(parameter, argumentName, classDecl); + } + else + { + CreateNativeParameter(parameter, $"&{argumentName}", classDecl); + } } } @@ -745,13 +757,12 @@ protected void WritePointerToArray(Parameter parameter, string argumentName, Cla { if (classDecl.IsSimpleType) { - WriteLine($"{classDecl.FullName}* {argumentName} = {NullPointer};"); + WriteLine($"{classDecl.FullName}{typeStrResult.TypeSuffix} {argumentName} = {Default};"); } else { - WriteLine($"{classDecl.NativeStruct.FullName}* {argumentName} = {NullPointer};"); + WriteLine($"{classDecl.NativeStruct.FullName}{typeStrResult.TypeSuffix} {argumentName} = {Default};"); } - } if (classDecl.IsWrapper) @@ -763,7 +774,7 @@ protected void WritePointerToArray(Parameter parameter, string argumentName, Cla PostActions.Enqueue(() => ConvertPointerToArray(parameter, argumentName, classDecl, arrayType)); } } - + CreateNativeParameter(parameter, argumentName, classDecl); } @@ -951,13 +962,16 @@ protected void WritePointerToPrimitiveType(Parameter parameter, string argumentN var interopType = parameter.Type.Visit(TypePrinter); TypePrinter.PopParameter(); TypePrinter.PopMarshalType(); - WriteLine($"var {argumentName} = {StackAlloc} {interopType.Type}[1];"); - if (parameter.ParameterKind != ParameterKind.Out) + if (parameter.ParameterKind is ParameterKind.In or ParameterKind.Readonly || parameter.Type.IsPointerToSimpleType() || parameter.IsOverload) { - WriteLine($"*{argumentName} = {parameter.Name};"); + WriteLine($"var {argumentName} = {StackAlloc} {interopType.Type}[1];"); + if (parameter.ParameterKind != ParameterKind.Out) + { + WriteLine($"*{argumentName} = {parameter.Name};"); + } } - if (parameter.ParameterKind is ParameterKind.Ref or ParameterKind.Out) + if (parameter.ParameterKind is ParameterKind.Ref or ParameterKind.Out && (parameter.Type.IsPointerToSimpleType() || parameter.IsOverload)) { PostActions.Enqueue(() => ConvertOutPrimitiveTypePointerToValue(parameter, argumentName)); } @@ -1180,14 +1194,20 @@ void ConvertPointerToEnum(Parameter parameter, string argumentName) UnindentAndWriteCloseBrace(); WriteDefaultOutParameterInitialization(parameter); } - + protected void CreateNativeParameter(Parameter parameter, string argumentName, Declaration decl) { var clonedType = (BindingType)parameter.Type.Clone(); clonedType.Declaration = decl; - + NativeParameters.Add(new Parameter() - { Name = argumentName, IsOverload = parameter.IsOverload, ParameterKind = parameter.ParameterKind, Type = clonedType }); + { + Name = argumentName, + IsOverload = parameter.IsOverload, + ParameterKind = parameter.ParameterKind, + OriginalParameter = parameter.OriginalParameter, + Type = clonedType + }); } private void ConvertReturnType() diff --git a/QuantumBinding.Generator/CodeGeneration/MethodToFunctionCodeGenerator.cs b/QuantumBinding.Generator/CodeGeneration/MethodToFunctionCodeGenerator.cs index d4ce7a0..0233f95 100644 --- a/QuantumBinding.Generator/CodeGeneration/MethodToFunctionCodeGenerator.cs +++ b/QuantumBinding.Generator/CodeGeneration/MethodToFunctionCodeGenerator.cs @@ -110,7 +110,7 @@ protected override void ProcessParameter(Parameter parameter, string argumentNam var t = parameter.Type.Visit(TypePrinter); TypePrinter.PopMarshalType(); TypePrinter.PopParameter(); - WriteLine($"{t} p{parameter.Name};"); + WriteLine($"{t} p{parameter.Name} = {Default};"); CreateNativeParameter(parameter, $"p{parameter.Name}", null); string arraySizeSource = string.Empty; @@ -140,7 +140,11 @@ protected override void ProcessParameter(Parameter parameter, string argumentNam else if (parameter.Type.IsPointerToBuiltInType(out var prim) && !parameter.Type.IsPurePointer()) { WritePointerToPrimitiveType(parameter, argumentName); - + if (parameter.ParameterKind is ParameterKind.Ref or ParameterKind.Out && !parameter.IsOverload) + { + argumentName = parameter.Name; + } + CreateNativeParameter(parameter, argumentName, null); } // The input parameter is void*, so we need to just pass it as is without any conversion diff --git a/QuantumBinding.Generator/CodeGeneration/MethodToRefStructCodeGenerator.cs b/QuantumBinding.Generator/CodeGeneration/MethodToRefStructCodeGenerator.cs index 99f3f53..d3232ab 100644 --- a/QuantumBinding.Generator/CodeGeneration/MethodToRefStructCodeGenerator.cs +++ b/QuantumBinding.Generator/CodeGeneration/MethodToRefStructCodeGenerator.cs @@ -75,7 +75,7 @@ void GenerateCalculateSizeMethod(Method method) firstParameter.Type.Declaration = method.Class; parameters.Insert(0, firstParameter); } - + var parametersResult = TypePrinter.VisitParameters(parameters, MarshalTypes.SkipParamModifiers, method.IsExtensionMethod); @@ -147,10 +147,6 @@ void GenerateCalculateSizeMethod(Method method) { WriteLine($"{totalSizeName} += {parameter.Name}.Length * sizeof({PrimitiveType.Nuint.GetDisplayName()});"); } - else if (parameter.Type.IsDoublePointer()) - { - WriteLine($"{totalSizeName} += sizeof({PrimitiveType.Nuint.GetDisplayName()});"); - } else if (parameter.Type.IsWrapper()) { WriteLine($"if ({parameter.Name} != null)"); @@ -158,6 +154,10 @@ void GenerateCalculateSizeMethod(Method method) WriteLine($"{totalSizeName} += {parameter.Name}.GetSize();"); PopIndent(); } + else if (parameter.Type.IsDoublePointer()) + { + WriteLine($"{totalSizeName} += sizeof({PrimitiveType.Nuint.GetDisplayName()});"); + } } WriteLine($"return {totalSizeName};"); diff --git a/QuantumBinding.Generator/CodeGeneration/WrapperGenerator.cs b/QuantumBinding.Generator/CodeGeneration/WrapperGenerator.cs index d365cff..7c315ae 100755 --- a/QuantumBinding.Generator/CodeGeneration/WrapperGenerator.cs +++ b/QuantumBinding.Generator/CodeGeneration/WrapperGenerator.cs @@ -1215,7 +1215,9 @@ private void MarshalFixedArrayToManaged(Property property, Class parentClass, Cl } else if (arrayType.ElementType.IsPurePointer()) { + TypePrinter.PushMarshalType(MarshalTypes.Property); var propertyArrayElementType = arrayType.ElementType.Visit(TypePrinter); + TypePrinter.PopMarshalType(); string tempArrayName = $"tmp{property.Name}"; WriteLine($"var {tempArrayName} = new {propertyArrayElementType}[{size}];"); WriteLine($"for (int i = 0; i < {size}; ++i)"); diff --git a/QuantumBinding.Generator/Parser/Clang/ClangParser.cs b/QuantumBinding.Generator/Parser/Clang/ClangParser.cs index 5ef8577..543c87c 100644 --- a/QuantumBinding.Generator/Parser/Clang/ClangParser.cs +++ b/QuantumBinding.Generator/Parser/Clang/ClangParser.cs @@ -443,7 +443,6 @@ private CXChildVisitResult VisitTypedef(QBCursor cursor, QBCursor parent, QBClie { var @struct = (Class)@class.Clone(); @struct.ClassType = ClassType.Struct; - @struct.Name += "Impl"; var field1 = new Field(); field1.AccessSpecifier = AccessSpecifier.Public; field1.Name = "pointer"; diff --git a/QuantumBinding.Generator/Processors/FunctionToInstanceMethodPass.cs b/QuantumBinding.Generator/Processors/FunctionToInstanceMethodPass.cs index 8749355..4e5b60c 100755 --- a/QuantumBinding.Generator/Processors/FunctionToInstanceMethodPass.cs +++ b/QuantumBinding.Generator/Processors/FunctionToInstanceMethodPass.cs @@ -9,22 +9,17 @@ namespace QuantumBinding.Generator.Processors; public class FunctionToInstanceMethodPass : PreGeneratorPass { - private List skipOverloadList; + private readonly List _skipOverloadList; public FunctionToInstanceMethodPass() { - skipOverloadList = new List(); + _skipOverloadList = new List(); Options.VisitFunctions = true; } - public void SkipOverloadForFunction(string name) - { - skipOverloadList.Add(name); - } - public void SkipOverloadForFunctions(params string[] names) { - skipOverloadList.AddRange(names); + _skipOverloadList.AddRange(names); } public override bool VisitFunction(Function function) @@ -57,7 +52,7 @@ public override bool VisitFunction(Function function) CurrentNamespace.AddDeclaration(globalMethod); - if (CurrentNamespace.Module.GenerateOverloadsForArrayParams && !skipOverloadList.Contains(function.Name)) + if (CurrentNamespace.Module.GenerateOverloadsForArrayParams && !_skipOverloadList.Contains(function.Name)) { var overload = GenerateMethodOverload(globalMethod); @@ -151,7 +146,7 @@ public override bool VisitFunction(Function function) method.Class = @class; @class.AddMethod(method); - if (CurrentNamespace.Module.GenerateOverloadsForArrayParams && !skipOverloadList.Contains(function.Name)) + if (CurrentNamespace.Module.GenerateOverloadsForArrayParams && !_skipOverloadList.Contains(function.Name)) { var overloadMethod = GenerateMethodOverload(method); @class.AddMethods(overloadMethod); @@ -209,9 +204,10 @@ private List GenerateMethodOverload(Method method) parametersList.Add(param); - var overloadedMethod = (Method)method.Clone(); - overloadedMethod.Parameters.Clear(); - overloadedMethod.IsOverload = true; + var methodOverload = (Method)method.Clone(); + methodOverload.Parameters.Clear(); + methodOverload.IsOverload = true; + for (var index = 0; index < method.Parameters.Count; index++) { var parameter = method.Parameters[index]; @@ -231,24 +227,25 @@ private List GenerateMethodOverload(Method method) { var funcParamClone = (Parameter)parameterClone.Clone(); funcParamClone.IsOverload = true; - overloadedMethod.Function.Parameters[(int)functionParameter.Index] = funcParamClone; + funcParamClone.OriginalParameter = functionParameter; + methodOverload.Function.Parameters[(int)functionParameter.Index] = funcParamClone; } } parameterClone.IsOverload = true; - overloadedMethod.Parameters.Add(parameterClone); - + methodOverload.Parameters.Add(parameterClone); } - methods.Add(overloadedMethod); + methods.Add(methodOverload); } // Create last overload where all array parameters will be replaced to a single one // This is valid only if method contains more than 1 array parameter if (parametersList.Count > 1) { - var overloadedMethod = (Method)method.Clone(); - overloadedMethod.IsOverload = true; + var methodOverload = (Method)method.Clone(); + methodOverload.IsOverload = true; + for (var index = 0; index < method.Parameters.Count; index++) { var parameter = method.Parameters[index]; @@ -266,14 +263,15 @@ private List GenerateMethodOverload(Method method) { var funcParamClone = (Parameter)parameterClone.Clone(); funcParamClone.IsOverload = true; - overloadedMethod.Function.Parameters[(int)functionParameter.Index] = funcParamClone; + funcParamClone.OriginalParameter = functionParameter; + methodOverload.Function.Parameters[(int)functionParameter.Index] = funcParamClone; } parameterClone.IsOverload = true; - overloadedMethod.Parameters[index] = parameterClone; + methodOverload.Parameters[index] = parameterClone; } } - methods.Add(overloadedMethod); + methods.Add(methodOverload); } return methods; diff --git a/QuantumBinding.Generator/Processors/NormalizeParametersPass.cs b/QuantumBinding.Generator/Processors/NormalizeParametersPass.cs index 39e214a..27fca05 100755 --- a/QuantumBinding.Generator/Processors/NormalizeParametersPass.cs +++ b/QuantumBinding.Generator/Processors/NormalizeParametersPass.cs @@ -89,7 +89,7 @@ public override bool VisitClass(Class @class) var field = new Field("pointer"); field.AccessSpecifier = AccessSpecifier.Public; field.Name = "pointer"; - field.Type = new PointerType() { Pointee = new BuiltinType(PrimitiveType.Nuint) }; + field.Type = new PointerType() { Pointee = new BuiltinType(PrimitiveType.Void) }; @class.NativeStruct.AddField(field); } diff --git a/QuantumBinding.Generator/Types/TypeUtil.cs b/QuantumBinding.Generator/Types/TypeUtil.cs index 530b54d..ed1f84b 100755 --- a/QuantumBinding.Generator/Types/TypeUtil.cs +++ b/QuantumBinding.Generator/Types/TypeUtil.cs @@ -84,7 +84,7 @@ public static bool IsPointerToVoid(this BindingType type, out uint depth) } } while (pointer.Pointee is PointerType); - return primitive == PrimitiveType.Void; + return primitive is PrimitiveType.Void or PrimitiveType.Nuint; } public static bool IsPointerToObject(this BindingType type) @@ -116,7 +116,7 @@ public static bool IsPointerToBuiltInType(this BindingType type, out PrimitiveTy var isPrimitive = IsPointerToPrimitiveType(type, out primitive); if (isPrimitive && - (primitive is PrimitiveType.IntPtr or PrimitiveType.UintPtr or PrimitiveType.Void)) + (primitive is PrimitiveType.IntPtr or PrimitiveType.UintPtr or PrimitiveType.Void or PrimitiveType.Nuint)) { return false; } @@ -139,7 +139,7 @@ public static bool IsPointerToSimpleType(this BindingType type) return false; } - if (pointer.Declaration is Class classDecl && classDecl.IsSimpleType) return true; + if (pointer.Declaration is Class { IsSimpleType: true }) return true; return false; } diff --git a/QuantumBinding.Generator/Utils/ClangUtils.cs b/QuantumBinding.Generator/Utils/ClangUtils.cs index e16f261..09efdb4 100644 --- a/QuantumBinding.Generator/Utils/ClangUtils.cs +++ b/QuantumBinding.Generator/Utils/ClangUtils.cs @@ -112,15 +112,32 @@ out uint column type = new CustomType(functionType); break; case CXTypeKind.CXType_Pointer: - //var pointeeType = clang.getCanonicalType(clang.getPointeeType(cursorType)); var pointeeType = cursorType.GetPointeeType(); - var pointer = new PointerType(); - + if (pointeeType.Kind == CXTypeKind.CXType_FunctionProto) { - pointeeType = pointeeType.GetResultType(); - } + var funcPtrType = new DelegateType(); + var returnType = pointeeType.GetResultType().GetBindingType(); + + int numArgTypes = pointeeType.GetNumArgTypes(); + for (uint i = 0; i < (uint)numArgTypes; ++i) + { + var argType = pointeeType.GetArgType(i); + var parameterType = argType.GetBindingType(); + var parameter = new Parameter(); + parameter.Type = parameterType; + funcPtrType.Parameters.Add(parameter); + } + var returnParameter = new Parameter(); + returnParameter.Type = returnType; + funcPtrType.Parameters.Add(returnParameter); + + type = funcPtrType; + break; + } + + var pointer = new PointerType(); var isBuiltin = pointeeType.IsPrimitiveType(); if (isBuiltin) From b10ad686ae8dc48ba478d6a6ece8bfdaf4b72709 Mon Sep 17 00:00:00 2001 From: "denis.zaporozhets" Date: Mon, 18 May 2026 12:26:40 +0300 Subject: [PATCH 3/3] regenerate main clang bindings --- .../Generated/Classes/QBClientData.cs | 16 +- .../Generated/Classes/QBCompletionString.cs | 16 +- .../Generated/Classes/QBDiagnostic.cs | 16 +- .../Generated/Classes/QBDiagnosticSet.cs | 16 +- .../Generated/Classes/QBEvalResult.cs | 16 +- .../Generated/Classes/QBFile.cs | 22 +- .../Generated/Classes/QBIdxClientASTFile.cs | 16 +- .../Generated/Classes/QBIdxClientContainer.cs | 16 +- .../Generated/Classes/QBIdxClientEntity.cs | 16 +- .../Generated/Classes/QBIdxClientFile.cs | 16 +- .../Generated/Classes/QBIndex.cs | 28 +-- .../Generated/Classes/QBIndexAction.cs | 30 +-- .../Generated/Classes/QBModule.cs | 16 +- .../Classes/QBModuleMapDescriptor.cs | 7 +- .../Generated/Classes/QBPrintingPolicy.cs | 16 +- .../Generated/Classes/QBRemapping.cs | 16 +- .../Generated/Classes/QBTranslationUnit.cs | 26 +- .../Generated/Classes/QBVirtualFileOverlay.cs | 7 +- .../Interop/Delegates/CXCursorVisitor.cs | 14 +- .../Interop/Delegates/CXFieldVisitor.cs | 14 +- .../Interop/Delegates/CXInclusionVisitor.cs | 14 +- .../QuantumBinding.Clang.Functions.cs | 230 +++++++++--------- .../OldFashionDelegates.cs | 6 +- .../Generated/Interop/Structs/CXAPISetImpl.cs | 2 +- .../Generated/Interop/Structs/CXClientData.cs | 24 ++ .../Generated/Interop/Structs/CXComment.cs | 2 +- .../Interop/Structs/CXCompletionResult.cs | 2 +- .../Interop/Structs/CXCompletionString.cs | 24 ++ .../Structs/CXCursorAndRangeVisitor.cs | 5 +- .../Interop/Structs/CXCursorSetImpl.cs | 2 +- .../Generated/Interop/Structs/CXDiagnostic.cs | 24 ++ ...CXClientDataImpl.cs => CXDiagnosticSet.cs} | 7 +- ...ompletionStringImpl.cs => CXEvalResult.cs} | 7 +- .../Interop/Structs/CXEvalResultImpl.cs | 21 -- .../{CXDiagnosticImpl.cs => CXFile.cs} | 7 +- .../Generated/Interop/Structs/CXFileImpl.cs | 21 -- .../Interop/Structs/CXIdxClientASTFile.cs | 24 ++ .../Interop/Structs/CXIdxClientASTFileImpl.cs | 21 -- .../Interop/Structs/CXIdxClientContainer.cs | 24 ++ .../Structs/CXIdxClientContainerImpl.cs | 21 -- .../Interop/Structs/CXIdxClientEntity.cs | 24 ++ .../Interop/Structs/CXIdxClientEntityImpl.cs | 21 -- ...iagnosticSetImpl.cs => CXIdxClientFile.cs} | 7 +- .../Interop/Structs/CXIdxClientFileImpl.cs | 21 -- .../Structs/CXIdxImportedASTFileInfo.cs | 5 +- .../Interop/Structs/CXIdxIncludedFileInfo.cs | 3 +- .../Generated/Interop/Structs/CXIndex.cs | 24 ++ .../Interop/Structs/CXIndexAction.cs | 24 ++ .../Interop/Structs/CXIndexActionImpl.cs | 21 -- .../Generated/Interop/Structs/CXIndexImpl.cs | 21 -- .../Generated/Interop/Structs/CXModule.cs | 24 ++ .../Generated/Interop/Structs/CXModuleImpl.cs | 21 -- .../Structs/CXModuleMapDescriptorImpl.cs | 2 +- .../Interop/Structs/CXPrintingPolicy.cs | 24 ++ .../Interop/Structs/CXPrintingPolicyImpl.cs | 21 -- .../Generated/Interop/Structs/CXRemapping.cs | 24 ++ .../Interop/Structs/CXRemappingImpl.cs | 21 -- .../Generated/Interop/Structs/CXString.cs | 2 +- .../Interop/Structs/CXTUResourceUsage.cs | 2 +- .../Interop/Structs/CXTargetInfoImpl.cs | 2 +- .../Generated/Interop/Structs/CXToken.cs | 2 +- .../Interop/Structs/CXTranslationUnitImpl.cs | 2 +- .../Structs/CXVirtualFileOverlayImpl.cs | 2 +- .../Interop/Structs/IndexerCallbacks.cs | 17 +- .../Interop/Structs/_CXChildVisitResult.cs | 2 +- .../Structs/_CXCursorAndRangeVisitorBlock.cs | 2 +- .../QuantumBinding.Clang.StaticMethods.cs | 24 +- .../StructWrappers/IndexerCallbacks.cs | 19 +- .../StructWrappers/QBCodeCompleteResults.cs | 3 + .../Generated/StructWrappers/QBComment.cs | 10 +- .../StructWrappers/QBCompletionResult.cs | 8 +- .../Generated/StructWrappers/QBCursor.cs | 39 +-- .../StructWrappers/QBCursorAndRangeVisitor.cs | 14 +- .../StructWrappers/QBFileUniqueID.cs | 6 +- .../StructWrappers/QBIdxCXXClassDeclInfo.cs | 7 +- .../Generated/StructWrappers/QBIdxDeclInfo.cs | 7 +- .../StructWrappers/QBIdxEntityInfo.cs | 7 +- .../StructWrappers/QBIdxEntityRefInfo.cs | 3 + .../QBIdxImportedASTFileInfo.cs | 13 +- .../StructWrappers/QBIdxIncludedFileInfo.cs | 8 +- .../Generated/StructWrappers/QBIdxLoc.cs | 9 +- .../QBIdxObjCProtocolRefListInfo.cs | 7 +- .../StructWrappers/QBIndexOptions.cs | 3 + .../StructWrappers/QBPlatformAvailability.cs | 3 + .../StructWrappers/QBSourceLocation.cs | 23 +- .../Generated/StructWrappers/QBSourceRange.cs | 3 + .../StructWrappers/QBSourceRangeList.cs | 3 + .../Generated/StructWrappers/QBString.cs | 10 +- .../StructWrappers/QBTUResourceUsage.cs | 10 +- .../Generated/StructWrappers/QBToken.cs | 13 +- .../Generated/StructWrappers/QBType.cs | 13 +- .../Generated/StructWrappers/QBUnsavedFile.cs | 3 + .../Generated/StructWrappers/QBVersion.cs | 3 + .../Parser/Clang/ClangParser.cs | 8 +- .../Parser/Clang/ForwardDeclarationVisitor.cs | 2 +- .../Parser/Clang/ICXCursorVisitor.cs | 2 +- 96 files changed, 783 insertions(+), 669 deletions(-) create mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXClientData.cs create mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXCompletionString.cs create mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXDiagnostic.cs rename QuantumBinding.Clang/Generated/Interop/Structs/{CXClientDataImpl.cs => CXDiagnosticSet.cs} (81%) rename QuantumBinding.Clang/Generated/Interop/Structs/{CXCompletionStringImpl.cs => CXEvalResult.cs} (81%) delete mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXEvalResultImpl.cs rename QuantumBinding.Clang/Generated/Interop/Structs/{CXDiagnosticImpl.cs => CXFile.cs} (78%) delete mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXFileImpl.cs create mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientASTFile.cs delete mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientASTFileImpl.cs create mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientContainer.cs delete mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientContainerImpl.cs create mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientEntity.cs delete mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientEntityImpl.cs rename QuantumBinding.Clang/Generated/Interop/Structs/{CXDiagnosticSetImpl.cs => CXIdxClientFile.cs} (78%) delete mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientFileImpl.cs create mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXIndex.cs create mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXIndexAction.cs delete mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXIndexActionImpl.cs delete mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXIndexImpl.cs create mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXModule.cs delete mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXModuleImpl.cs create mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXPrintingPolicy.cs delete mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXPrintingPolicyImpl.cs create mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXRemapping.cs delete mode 100644 QuantumBinding.Clang/Generated/Interop/Structs/CXRemappingImpl.cs diff --git a/QuantumBinding.Clang/Generated/Classes/QBClientData.cs b/QuantumBinding.Clang/Generated/Classes/QBClientData.cs index d77f198..aad9d5f 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBClientData.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBClientData.cs @@ -16,27 +16,27 @@ namespace QuantumBinding.Clang; /// /// Opaque pointer representing client data that will be passed through to various callbacks and visitors. /// -public unsafe partial class QBClientData : IUnmanagedWrapper +public unsafe partial class QBClientData : IUnmanagedWrapper { - internal CXClientDataImpl __Instance; + internal CXClientData __Instance; public QBClientData() { } - public QBClientData(in QuantumBinding.Clang.Interop.CXClientDataImpl __Instance) + public QBClientData(in QuantumBinding.Clang.Interop.CXClientData __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXClientDataImpl GetNativeValue() => __Instance; - public ref readonly CXClientDataImpl GetPinnableReference() => ref __Instance; + public QuantumBinding.Clang.Interop.CXClientData GetNativeValue() => __Instance; + public ref readonly CXClientData GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXClientDataImpl(QBClientData q) + public static implicit operator QuantumBinding.Clang.Interop.CXClientData(QBClientData q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXClientDataImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXClientData(); } - public static implicit operator QBClientData(QuantumBinding.Clang.Interop.CXClientDataImpl q) + public static implicit operator QBClientData(QuantumBinding.Clang.Interop.CXClientData q) { return new QBClientData(in q); } diff --git a/QuantumBinding.Clang/Generated/Classes/QBCompletionString.cs b/QuantumBinding.Clang/Generated/Classes/QBCompletionString.cs index e1737f1..3dc4f6c 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBCompletionString.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBCompletionString.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// A semantic string that describes a code-completion result. /// -public unsafe partial class QBCompletionString : IUnmanagedWrapper +public unsafe partial class QBCompletionString : IUnmanagedWrapper { - internal CXCompletionStringImpl __Instance; + internal CXCompletionString __Instance; public QBCompletionString() { } - public QBCompletionString(in QuantumBinding.Clang.Interop.CXCompletionStringImpl __Instance) + public QBCompletionString(in QuantumBinding.Clang.Interop.CXCompletionString __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXCompletionStringImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXCompletionString GetNativeValue() => __Instance; /// /// Retrieve the annotation associated with the given completion string. /// @@ -116,14 +116,14 @@ public uint GetNumCompletionChunks() return QuantumBinding.Clang.Interop.ClangInterop.clang_getNumCompletionChunks(this); } - public ref readonly CXCompletionStringImpl GetPinnableReference() => ref __Instance; + public ref readonly CXCompletionString GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXCompletionStringImpl(QBCompletionString q) + public static implicit operator QuantumBinding.Clang.Interop.CXCompletionString(QBCompletionString q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXCompletionStringImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXCompletionString(); } - public static implicit operator QBCompletionString(QuantumBinding.Clang.Interop.CXCompletionStringImpl q) + public static implicit operator QBCompletionString(QuantumBinding.Clang.Interop.CXCompletionString q) { return new QBCompletionString(in q); } diff --git a/QuantumBinding.Clang/Generated/Classes/QBDiagnostic.cs b/QuantumBinding.Clang/Generated/Classes/QBDiagnostic.cs index f7b5c88..d8652ef 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBDiagnostic.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBDiagnostic.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// A single diagnostic, containing the diagnostic's severity, location, text, source ranges, and fix-it hints. /// -public unsafe partial class QBDiagnostic : IUnmanagedWrapper +public unsafe partial class QBDiagnostic : IUnmanagedWrapper { - internal CXDiagnosticImpl __Instance; + internal CXDiagnostic __Instance; public QBDiagnostic() { } - public QBDiagnostic(in QuantumBinding.Clang.Interop.CXDiagnosticImpl __Instance) + public QBDiagnostic(in QuantumBinding.Clang.Interop.CXDiagnostic __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXDiagnosticImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXDiagnostic GetNativeValue() => __Instance; /// /// Destroy a diagnostic. /// @@ -175,14 +175,14 @@ public QBString GetDiagnosticSpelling() return QuantumBinding.Clang.Interop.ClangInterop.clang_getDiagnosticSpelling(this); } - public ref readonly CXDiagnosticImpl GetPinnableReference() => ref __Instance; + public ref readonly CXDiagnostic GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXDiagnosticImpl(QBDiagnostic q) + public static implicit operator QuantumBinding.Clang.Interop.CXDiagnostic(QBDiagnostic q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXDiagnosticImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXDiagnostic(); } - public static implicit operator QBDiagnostic(QuantumBinding.Clang.Interop.CXDiagnosticImpl q) + public static implicit operator QBDiagnostic(QuantumBinding.Clang.Interop.CXDiagnostic q) { return new QBDiagnostic(in q); } diff --git a/QuantumBinding.Clang/Generated/Classes/QBDiagnosticSet.cs b/QuantumBinding.Clang/Generated/Classes/QBDiagnosticSet.cs index 00ad65e..8979e6b 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBDiagnosticSet.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBDiagnosticSet.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// A group of CXDiagnostics. /// -public unsafe partial class QBDiagnosticSet : IUnmanagedWrapper +public unsafe partial class QBDiagnosticSet : IUnmanagedWrapper { - internal CXDiagnosticSetImpl __Instance; + internal CXDiagnosticSet __Instance; public QBDiagnosticSet() { } - public QBDiagnosticSet(in QuantumBinding.Clang.Interop.CXDiagnosticSetImpl __Instance) + public QBDiagnosticSet(in QuantumBinding.Clang.Interop.CXDiagnosticSet __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXDiagnosticSetImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXDiagnosticSet GetNativeValue() => __Instance; /// /// Release a CXDiagnosticSet and all of its contained diagnostics. /// @@ -53,14 +53,14 @@ public uint GetNumDiagnosticsInSet() return QuantumBinding.Clang.Interop.ClangInterop.clang_getNumDiagnosticsInSet(this); } - public ref readonly CXDiagnosticSetImpl GetPinnableReference() => ref __Instance; + public ref readonly CXDiagnosticSet GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXDiagnosticSetImpl(QBDiagnosticSet q) + public static implicit operator QuantumBinding.Clang.Interop.CXDiagnosticSet(QBDiagnosticSet q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXDiagnosticSetImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXDiagnosticSet(); } - public static implicit operator QBDiagnosticSet(QuantumBinding.Clang.Interop.CXDiagnosticSetImpl q) + public static implicit operator QBDiagnosticSet(QuantumBinding.Clang.Interop.CXDiagnosticSet q) { return new QBDiagnosticSet(in q); } diff --git a/QuantumBinding.Clang/Generated/Classes/QBEvalResult.cs b/QuantumBinding.Clang/Generated/Classes/QBEvalResult.cs index 678465b..830f55d 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBEvalResult.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBEvalResult.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// Evaluation result of a cursor /// -public unsafe partial class QBEvalResult : IUnmanagedWrapper +public unsafe partial class QBEvalResult : IUnmanagedWrapper { - internal CXEvalResultImpl __Instance; + internal CXEvalResult __Instance; public QBEvalResult() { } - public QBEvalResult(in QuantumBinding.Clang.Interop.CXEvalResultImpl __Instance) + public QBEvalResult(in QuantumBinding.Clang.Interop.CXEvalResult __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXEvalResultImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXEvalResult GetNativeValue() => __Instance; /// /// Disposes the created Eval memory. /// @@ -94,14 +94,14 @@ public uint EvalResult_isUnsignedInt() return QuantumBinding.Clang.Interop.ClangInterop.clang_EvalResult_isUnsignedInt(this); } - public ref readonly CXEvalResultImpl GetPinnableReference() => ref __Instance; + public ref readonly CXEvalResult GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXEvalResultImpl(QBEvalResult q) + public static implicit operator QuantumBinding.Clang.Interop.CXEvalResult(QBEvalResult q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXEvalResultImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXEvalResult(); } - public static implicit operator QBEvalResult(QuantumBinding.Clang.Interop.CXEvalResultImpl q) + public static implicit operator QBEvalResult(QuantumBinding.Clang.Interop.CXEvalResult q) { return new QBEvalResult(in q); } diff --git a/QuantumBinding.Clang/Generated/Classes/QBFile.cs b/QuantumBinding.Clang/Generated/Classes/QBFile.cs index a8d895f..c4b58a9 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBFile.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBFile.cs @@ -16,25 +16,25 @@ namespace QuantumBinding.Clang; /// /// A particular source file that is part of a translation unit. /// -public unsafe partial class QBFile : IUnmanagedWrapper +public unsafe partial class QBFile : IUnmanagedWrapper { - internal CXFileImpl __Instance; + internal CXFile __Instance; public QBFile() { } - public QBFile(in QuantumBinding.Clang.Interop.CXFileImpl __Instance) + public QBFile(in QuantumBinding.Clang.Interop.CXFile __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXFileImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXFile GetNativeValue() => __Instance; /// /// Returns non-zero if the file1 and file2 point to the same file, or they are both NULL. /// public int File_isEqual(QuantumBinding.Clang.QBFile file2) { - var arg1 = file2 == null ? new CXFileImpl() : (CXFileImpl)file2; + var arg1 = file2 == null ? new CXFile() : (CXFile)file2; return QuantumBinding.Clang.Interop.ClangInterop.clang_File_isEqual(this, arg1); } @@ -67,20 +67,20 @@ public long GetFileTime() /// public int GetFileUniqueID(out QBFileUniqueID outID) { - QuantumBinding.Clang.Interop.CXFileUniqueID arg1; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_getFileUniqueID(this, out arg1); + QuantumBinding.Clang.Interop.CXFileUniqueID arg1 = default; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_getFileUniqueID(this, &arg1); outID = new QBFileUniqueID(arg1); return result; } - public ref readonly CXFileImpl GetPinnableReference() => ref __Instance; + public ref readonly CXFile GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXFileImpl(QBFile q) + public static implicit operator QuantumBinding.Clang.Interop.CXFile(QBFile q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXFileImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXFile(); } - public static implicit operator QBFile(QuantumBinding.Clang.Interop.CXFileImpl q) + public static implicit operator QBFile(QuantumBinding.Clang.Interop.CXFile q) { return new QBFile(in q); } diff --git a/QuantumBinding.Clang/Generated/Classes/QBIdxClientASTFile.cs b/QuantumBinding.Clang/Generated/Classes/QBIdxClientASTFile.cs index 23b5aa2..c44a326 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBIdxClientASTFile.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBIdxClientASTFile.cs @@ -16,27 +16,27 @@ namespace QuantumBinding.Clang; /// /// The client's data object that is associated with an AST file (PCH or module). /// -public unsafe partial class QBIdxClientASTFile : IUnmanagedWrapper +public unsafe partial class QBIdxClientASTFile : IUnmanagedWrapper { - internal CXIdxClientASTFileImpl __Instance; + internal CXIdxClientASTFile __Instance; public QBIdxClientASTFile() { } - public QBIdxClientASTFile(in QuantumBinding.Clang.Interop.CXIdxClientASTFileImpl __Instance) + public QBIdxClientASTFile(in QuantumBinding.Clang.Interop.CXIdxClientASTFile __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXIdxClientASTFileImpl GetNativeValue() => __Instance; - public ref readonly CXIdxClientASTFileImpl GetPinnableReference() => ref __Instance; + public QuantumBinding.Clang.Interop.CXIdxClientASTFile GetNativeValue() => __Instance; + public ref readonly CXIdxClientASTFile GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXIdxClientASTFileImpl(QBIdxClientASTFile q) + public static implicit operator QuantumBinding.Clang.Interop.CXIdxClientASTFile(QBIdxClientASTFile q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIdxClientASTFileImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIdxClientASTFile(); } - public static implicit operator QBIdxClientASTFile(QuantumBinding.Clang.Interop.CXIdxClientASTFileImpl q) + public static implicit operator QBIdxClientASTFile(QuantumBinding.Clang.Interop.CXIdxClientASTFile q) { return new QBIdxClientASTFile(in q); } diff --git a/QuantumBinding.Clang/Generated/Classes/QBIdxClientContainer.cs b/QuantumBinding.Clang/Generated/Classes/QBIdxClientContainer.cs index 8b8e93e..a98bf18 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBIdxClientContainer.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBIdxClientContainer.cs @@ -16,27 +16,27 @@ namespace QuantumBinding.Clang; /// /// The client's data object that is associated with a semantic container of entities. /// -public unsafe partial class QBIdxClientContainer : IUnmanagedWrapper +public unsafe partial class QBIdxClientContainer : IUnmanagedWrapper { - internal CXIdxClientContainerImpl __Instance; + internal CXIdxClientContainer __Instance; public QBIdxClientContainer() { } - public QBIdxClientContainer(in QuantumBinding.Clang.Interop.CXIdxClientContainerImpl __Instance) + public QBIdxClientContainer(in QuantumBinding.Clang.Interop.CXIdxClientContainer __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXIdxClientContainerImpl GetNativeValue() => __Instance; - public ref readonly CXIdxClientContainerImpl GetPinnableReference() => ref __Instance; + public QuantumBinding.Clang.Interop.CXIdxClientContainer GetNativeValue() => __Instance; + public ref readonly CXIdxClientContainer GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXIdxClientContainerImpl(QBIdxClientContainer q) + public static implicit operator QuantumBinding.Clang.Interop.CXIdxClientContainer(QBIdxClientContainer q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIdxClientContainerImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIdxClientContainer(); } - public static implicit operator QBIdxClientContainer(QuantumBinding.Clang.Interop.CXIdxClientContainerImpl q) + public static implicit operator QBIdxClientContainer(QuantumBinding.Clang.Interop.CXIdxClientContainer q) { return new QBIdxClientContainer(in q); } diff --git a/QuantumBinding.Clang/Generated/Classes/QBIdxClientEntity.cs b/QuantumBinding.Clang/Generated/Classes/QBIdxClientEntity.cs index 7cef11c..b58c56e 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBIdxClientEntity.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBIdxClientEntity.cs @@ -16,27 +16,27 @@ namespace QuantumBinding.Clang; /// /// The client's data object that is associated with a semantic entity. /// -public unsafe partial class QBIdxClientEntity : IUnmanagedWrapper +public unsafe partial class QBIdxClientEntity : IUnmanagedWrapper { - internal CXIdxClientEntityImpl __Instance; + internal CXIdxClientEntity __Instance; public QBIdxClientEntity() { } - public QBIdxClientEntity(in QuantumBinding.Clang.Interop.CXIdxClientEntityImpl __Instance) + public QBIdxClientEntity(in QuantumBinding.Clang.Interop.CXIdxClientEntity __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXIdxClientEntityImpl GetNativeValue() => __Instance; - public ref readonly CXIdxClientEntityImpl GetPinnableReference() => ref __Instance; + public QuantumBinding.Clang.Interop.CXIdxClientEntity GetNativeValue() => __Instance; + public ref readonly CXIdxClientEntity GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXIdxClientEntityImpl(QBIdxClientEntity q) + public static implicit operator QuantumBinding.Clang.Interop.CXIdxClientEntity(QBIdxClientEntity q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIdxClientEntityImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIdxClientEntity(); } - public static implicit operator QBIdxClientEntity(QuantumBinding.Clang.Interop.CXIdxClientEntityImpl q) + public static implicit operator QBIdxClientEntity(QuantumBinding.Clang.Interop.CXIdxClientEntity q) { return new QBIdxClientEntity(in q); } diff --git a/QuantumBinding.Clang/Generated/Classes/QBIdxClientFile.cs b/QuantumBinding.Clang/Generated/Classes/QBIdxClientFile.cs index e3200f4..9c4550b 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBIdxClientFile.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBIdxClientFile.cs @@ -16,27 +16,27 @@ namespace QuantumBinding.Clang; /// /// The client's data object that is associated with a CXFile. /// -public unsafe partial class QBIdxClientFile : IUnmanagedWrapper +public unsafe partial class QBIdxClientFile : IUnmanagedWrapper { - internal CXIdxClientFileImpl __Instance; + internal CXIdxClientFile __Instance; public QBIdxClientFile() { } - public QBIdxClientFile(in QuantumBinding.Clang.Interop.CXIdxClientFileImpl __Instance) + public QBIdxClientFile(in QuantumBinding.Clang.Interop.CXIdxClientFile __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXIdxClientFileImpl GetNativeValue() => __Instance; - public ref readonly CXIdxClientFileImpl GetPinnableReference() => ref __Instance; + public QuantumBinding.Clang.Interop.CXIdxClientFile GetNativeValue() => __Instance; + public ref readonly CXIdxClientFile GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXIdxClientFileImpl(QBIdxClientFile q) + public static implicit operator QuantumBinding.Clang.Interop.CXIdxClientFile(QBIdxClientFile q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIdxClientFileImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIdxClientFile(); } - public static implicit operator QBIdxClientFile(QuantumBinding.Clang.Interop.CXIdxClientFileImpl q) + public static implicit operator QBIdxClientFile(QuantumBinding.Clang.Interop.CXIdxClientFile q) { return new QBIdxClientFile(in q); } diff --git a/QuantumBinding.Clang/Generated/Classes/QBIndex.cs b/QuantumBinding.Clang/Generated/Classes/QBIndex.cs index dc775c2..962c062 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBIndex.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBIndex.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// An "index" that consists of a set of translation units that would typically be linked together into an executable or library. /// -public unsafe partial class QBIndex : IUnmanagedWrapper +public unsafe partial class QBIndex : IUnmanagedWrapper { - internal CXIndexImpl __Instance; + internal CXIndex __Instance; public QBIndex() { } - public QBIndex(in QuantumBinding.Clang.Interop.CXIndexImpl __Instance) + public QBIndex(in QuantumBinding.Clang.Interop.CXIndex __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXIndexImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXIndex GetNativeValue() => __Instance; /// /// Same as clang_createTranslationUnit2, but returns the CXTranslationUnit instead of an error code. In case of an error this routine returns a NULL CXTranslationUnit, without further detailed error codes. /// @@ -78,8 +78,8 @@ int CalculateSize(string ast_filename) { ref System.Span currentCursor = ref mainBuffer; var arg1 = QuantumBinding.Utils.MarshalContextUtils.MarshalString(ast_filename, ref currentCursor); - CXTranslationUnitImpl arg2; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_createTranslationUnit2(this, arg1, out arg2); + CXTranslationUnitImpl arg2 = default; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_createTranslationUnit2(this, arg1, &arg2); out_TU = new QBTranslationUnit(arg2); return result; } @@ -253,8 +253,8 @@ int CalculateSize(string source_filename, System.ReadOnlySpan command_li { arg4 = QuantumBinding.Utils.MarshalContextUtils.MarshalArrayOfWrappers(unsaved_files, ref currentCursor); } - CXTranslationUnitImpl arg7; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_parseTranslationUnit2(this, arg1, arg2, num_command_line_args, arg4, num_unsaved_files, options, out arg7); + CXTranslationUnitImpl arg7 = default; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_parseTranslationUnit2(this, arg1, arg2, num_command_line_args, arg4, num_unsaved_files, options, &arg7); out_TU = new QBTranslationUnit(arg7); return result; } @@ -290,8 +290,8 @@ int CalculateSize(string source_filename, System.ReadOnlySpan command_li var arg1 = QuantumBinding.Utils.MarshalContextUtils.MarshalString(source_filename, ref currentCursor); var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStringArray(command_line_args, ref currentCursor); var arg4 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(unsaved_files, ref currentCursor); - CXTranslationUnitImpl arg7; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_parseTranslationUnit2FullArgv(this, arg1, arg2, num_command_line_args, arg4, num_unsaved_files, options, out arg7); + CXTranslationUnitImpl arg7 = default; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_parseTranslationUnit2FullArgv(this, arg1, arg2, num_command_line_args, arg4, num_unsaved_files, options, &arg7); out_TU = new QBTranslationUnit(arg7); return result; } @@ -302,14 +302,14 @@ int CalculateSize(string source_filename, System.ReadOnlySpan command_li } } - public ref readonly CXIndexImpl GetPinnableReference() => ref __Instance; + public ref readonly CXIndex GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXIndexImpl(QBIndex q) + public static implicit operator QuantumBinding.Clang.Interop.CXIndex(QBIndex q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIndexImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIndex(); } - public static implicit operator QBIndex(QuantumBinding.Clang.Interop.CXIndexImpl q) + public static implicit operator QBIndex(QuantumBinding.Clang.Interop.CXIndex q) { return new QBIndex(in q); } diff --git a/QuantumBinding.Clang/Generated/Classes/QBIndexAction.cs b/QuantumBinding.Clang/Generated/Classes/QBIndexAction.cs index 464ad2d..6cc51f7 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBIndexAction.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBIndexAction.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// An indexing action/session, to be applied to one or multiple translation units. /// -public unsafe partial class QBIndexAction : IUnmanagedWrapper +public unsafe partial class QBIndexAction : IUnmanagedWrapper { - internal CXIndexActionImpl __Instance; + internal CXIndexAction __Instance; public QBIndexAction() { } - public QBIndexAction(in QuantumBinding.Clang.Interop.CXIndexActionImpl __Instance) + public QBIndexAction(in QuantumBinding.Clang.Interop.CXIndexAction __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXIndexActionImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXIndexAction GetNativeValue() => __Instance; /// /// Destroy the given index action. /// @@ -61,13 +61,13 @@ int CalculateSize(IndexerCallbacks index_callbacks, string source_filename, Syst try { ref System.Span currentCursor = ref mainBuffer; - var arg1 = client_data == null ? new CXClientDataImpl() : (CXClientDataImpl)client_data; + var arg1 = client_data == null ? new CXClientData() : (CXClientData)client_data; var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(index_callbacks, ref currentCursor); var arg5 = QuantumBinding.Utils.MarshalContextUtils.MarshalString(source_filename, ref currentCursor); var arg6 = QuantumBinding.Utils.MarshalContextUtils.MarshalStringArray(command_line_args, ref currentCursor); var arg8 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(unsaved_files, ref currentCursor); - CXTranslationUnitImpl arg10; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_indexSourceFile(this, arg1, arg2, index_callbacks_size, index_options, arg5, arg6, num_command_line_args, arg8, num_unsaved_files, out arg10, tU_options); + CXTranslationUnitImpl arg10 = default; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_indexSourceFile(this, arg1, arg2, index_callbacks_size, index_options, arg5, arg6, num_command_line_args, arg8, num_unsaved_files, &arg10, tU_options); out_TU = new QBTranslationUnit(arg10); return result; } @@ -102,13 +102,13 @@ int CalculateSize(IndexerCallbacks index_callbacks, string source_filename, Syst try { ref System.Span currentCursor = ref mainBuffer; - var arg1 = client_data == null ? new CXClientDataImpl() : (CXClientDataImpl)client_data; + var arg1 = client_data == null ? new CXClientData() : (CXClientData)client_data; var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(index_callbacks, ref currentCursor); var arg5 = QuantumBinding.Utils.MarshalContextUtils.MarshalString(source_filename, ref currentCursor); var arg6 = QuantumBinding.Utils.MarshalContextUtils.MarshalStringArray(command_line_args, ref currentCursor); var arg8 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(unsaved_files, ref currentCursor); - CXTranslationUnitImpl arg10; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_indexSourceFileFullArgv(this, arg1, arg2, index_callbacks_size, index_options, arg5, arg6, num_command_line_args, arg8, num_unsaved_files, out arg10, tU_options); + CXTranslationUnitImpl arg10 = default; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_indexSourceFileFullArgv(this, arg1, arg2, index_callbacks_size, index_options, arg5, arg6, num_command_line_args, arg8, num_unsaved_files, &arg10, tU_options); out_TU = new QBTranslationUnit(arg10); return result; } @@ -138,7 +138,7 @@ int CalculateSize(IndexerCallbacks index_callbacks) try { ref System.Span currentCursor = ref mainBuffer; - var arg1 = client_data == null ? new CXClientDataImpl() : (CXClientDataImpl)client_data; + var arg1 = client_data == null ? new CXClientData() : (CXClientData)client_data; var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(index_callbacks, ref currentCursor); var arg5 = param5 == null ? new CXTranslationUnitImpl() : (CXTranslationUnitImpl)param5; return QuantumBinding.Clang.Interop.ClangInterop.clang_indexTranslationUnit(this, arg1, arg2, index_callbacks_size, index_options, arg5); @@ -150,14 +150,14 @@ int CalculateSize(IndexerCallbacks index_callbacks) } } - public ref readonly CXIndexActionImpl GetPinnableReference() => ref __Instance; + public ref readonly CXIndexAction GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXIndexActionImpl(QBIndexAction q) + public static implicit operator QuantumBinding.Clang.Interop.CXIndexAction(QBIndexAction q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIndexActionImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXIndexAction(); } - public static implicit operator QBIndexAction(QuantumBinding.Clang.Interop.CXIndexActionImpl q) + public static implicit operator QBIndexAction(QuantumBinding.Clang.Interop.CXIndexAction q) { return new QBIndexAction(in q); } diff --git a/QuantumBinding.Clang/Generated/Classes/QBModule.cs b/QuantumBinding.Clang/Generated/Classes/QBModule.cs index f3f8092..d1bf9ec 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBModule.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBModule.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// The functions in this group provide access to information about modules. /// -public unsafe partial class QBModule : IUnmanagedWrapper +public unsafe partial class QBModule : IUnmanagedWrapper { - internal CXModuleImpl __Instance; + internal CXModule __Instance; public QBModule() { } - public QBModule(in QuantumBinding.Clang.Interop.CXModuleImpl __Instance) + public QBModule(in QuantumBinding.Clang.Interop.CXModule __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXModuleImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXModule GetNativeValue() => __Instance; /// /// Returns the module file where the provided module object came from. /// @@ -69,14 +69,14 @@ public int Module_isSystem() return QuantumBinding.Clang.Interop.ClangInterop.clang_Module_isSystem(this); } - public ref readonly CXModuleImpl GetPinnableReference() => ref __Instance; + public ref readonly CXModule GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXModuleImpl(QBModule q) + public static implicit operator QuantumBinding.Clang.Interop.CXModule(QBModule q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXModuleImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXModule(); } - public static implicit operator QBModule(QuantumBinding.Clang.Interop.CXModuleImpl q) + public static implicit operator QBModule(QuantumBinding.Clang.Interop.CXModule q) { return new QBModule(in q); } diff --git a/QuantumBinding.Clang/Generated/Classes/QBModuleMapDescriptor.cs b/QuantumBinding.Clang/Generated/Classes/QBModuleMapDescriptor.cs index 6d73708..879ffda 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBModuleMapDescriptor.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBModuleMapDescriptor.cs @@ -98,9 +98,12 @@ int CalculateSize(string name) /// /// Write out the CXModuleMapDescriptor object to a char buffer. /// - public CXErrorCode ModuleMapDescriptor_writeToBuffer(uint options, out sbyte* out_buffer_ptr, out uint out_buffer_size) + public CXErrorCode ModuleMapDescriptor_writeToBuffer(uint options, out nuint out_buffer_ptr, out uint out_buffer_size) { - return QuantumBinding.Clang.Interop.ClangInterop.clang_ModuleMapDescriptor_writeToBuffer(this, options, out out_buffer_ptr, out out_buffer_size); + sbyte* arg2 = null; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_ModuleMapDescriptor_writeToBuffer(this, options, out arg2, out out_buffer_size); + out_buffer_ptr = (nuint)arg2; + return result; } public ref readonly CXModuleMapDescriptorImpl GetPinnableReference() => ref __Instance; diff --git a/QuantumBinding.Clang/Generated/Classes/QBPrintingPolicy.cs b/QuantumBinding.Clang/Generated/Classes/QBPrintingPolicy.cs index d9d9e0d..88f987a 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBPrintingPolicy.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBPrintingPolicy.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// Opaque pointer representing a policy that controls pretty printing for clang_getCursorPrettyPrinted. /// -public unsafe partial class QBPrintingPolicy : IUnmanagedWrapper +public unsafe partial class QBPrintingPolicy : IUnmanagedWrapper { - internal CXPrintingPolicyImpl __Instance; + internal CXPrintingPolicy __Instance; public QBPrintingPolicy() { } - public QBPrintingPolicy(in QuantumBinding.Clang.Interop.CXPrintingPolicyImpl __Instance) + public QBPrintingPolicy(in QuantumBinding.Clang.Interop.CXPrintingPolicy __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXPrintingPolicyImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXPrintingPolicy GetNativeValue() => __Instance; /// /// Release a printing policy. /// @@ -53,14 +53,14 @@ public void PrintingPolicy_setProperty(CXPrintingPolicyProperty property, uint v QuantumBinding.Clang.Interop.ClangInterop.clang_PrintingPolicy_setProperty(this, property, value); } - public ref readonly CXPrintingPolicyImpl GetPinnableReference() => ref __Instance; + public ref readonly CXPrintingPolicy GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXPrintingPolicyImpl(QBPrintingPolicy q) + public static implicit operator QuantumBinding.Clang.Interop.CXPrintingPolicy(QBPrintingPolicy q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXPrintingPolicyImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXPrintingPolicy(); } - public static implicit operator QBPrintingPolicy(QuantumBinding.Clang.Interop.CXPrintingPolicyImpl q) + public static implicit operator QBPrintingPolicy(QuantumBinding.Clang.Interop.CXPrintingPolicy q) { return new QBPrintingPolicy(in q); } diff --git a/QuantumBinding.Clang/Generated/Classes/QBRemapping.cs b/QuantumBinding.Clang/Generated/Classes/QBRemapping.cs index 88894b5..fd68f07 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBRemapping.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBRemapping.cs @@ -16,19 +16,19 @@ namespace QuantumBinding.Clang; /// /// CINDEX_DEPRECATED - disabled to silence MSVC deprecation warnings /// -public unsafe partial class QBRemapping : IUnmanagedWrapper +public unsafe partial class QBRemapping : IUnmanagedWrapper { - internal CXRemappingImpl __Instance; + internal CXRemapping __Instance; public QBRemapping() { } - public QBRemapping(in QuantumBinding.Clang.Interop.CXRemappingImpl __Instance) + public QBRemapping(in QuantumBinding.Clang.Interop.CXRemapping __Instance) { this.__Instance = __Instance; } - public QuantumBinding.Clang.Interop.CXRemappingImpl GetNativeValue() => __Instance; + public QuantumBinding.Clang.Interop.CXRemapping GetNativeValue() => __Instance; public void Remap_dispose() { QuantumBinding.Clang.Interop.ClangInterop.clang_remap_dispose(this); @@ -68,14 +68,14 @@ public uint Remap_getNumFiles() return QuantumBinding.Clang.Interop.ClangInterop.clang_remap_getNumFiles(this); } - public ref readonly CXRemappingImpl GetPinnableReference() => ref __Instance; + public ref readonly CXRemapping GetPinnableReference() => ref __Instance; - public static implicit operator QuantumBinding.Clang.Interop.CXRemappingImpl(QBRemapping q) + public static implicit operator QuantumBinding.Clang.Interop.CXRemapping(QBRemapping q) { - return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXRemappingImpl(); + return q?.__Instance ?? new QuantumBinding.Clang.Interop.CXRemapping(); } - public static implicit operator QBRemapping(QuantumBinding.Clang.Interop.CXRemappingImpl q) + public static implicit operator QBRemapping(QuantumBinding.Clang.Interop.CXRemapping q) { return new QBRemapping(in q); } diff --git a/QuantumBinding.Clang/Generated/Classes/QBTranslationUnit.cs b/QuantumBinding.Clang/Generated/Classes/QBTranslationUnit.cs index 9a83d97..2dfeee9 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBTranslationUnit.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBTranslationUnit.cs @@ -113,8 +113,8 @@ int CalculateSize(string complete_filename, QBUnsavedFile unsaved_files) /// public CXErrorCode CreateAPISet(out QuantumBinding.Clang.QBAPISet out_api) { - CXAPISetImpl arg1; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_createAPISet(this, out arg1); + CXAPISetImpl arg1 = default; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_createAPISet(this, &arg1); out_api = new QBAPISet(arg1); return result; } @@ -191,7 +191,7 @@ int CalculateSize(QBCursorAndRangeVisitor visitor) try { ref System.Span currentCursor = ref mainBuffer; - var arg1 = file == null ? new CXFileImpl() : (CXFileImpl)file; + var arg1 = file == null ? new CXFile() : (CXFile)file; var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToNative(visitor, ref currentCursor); return QuantumBinding.Clang.Interop.ClangInterop.clang_findIncludesInFile(this, arg1, arg2); } @@ -204,7 +204,7 @@ int CalculateSize(QBCursorAndRangeVisitor visitor) public CXResult FindIncludesInFileWithBlock(QuantumBinding.Clang.QBFile param1, QuantumBinding.Clang.QBCursorAndRangeVisitorBlock param2) { - var arg1 = param1 == null ? new CXFileImpl() : (CXFileImpl)param1; + var arg1 = param1 == null ? new CXFile() : (CXFile)param1; var arg2 = param2 == null ? new _CXCursorAndRangeVisitorBlock() : (_CXCursorAndRangeVisitorBlock)param2; return QuantumBinding.Clang.Interop.ClangInterop.clang_findIncludesInFileWithBlock(this, arg1, arg2); } @@ -307,7 +307,7 @@ int CalculateSize(string file_name) /// public string GetFileContents(QuantumBinding.Clang.QBFile file, out ulong size) { - var arg1 = file == null ? new CXFileImpl() : (CXFileImpl)file; + var arg1 = file == null ? new CXFile() : (CXFile)file; var result = QuantumBinding.Clang.Interop.ClangInterop.clang_getFileContents(this, arg1, out size); return new string(result); } @@ -317,7 +317,7 @@ public string GetFileContents(QuantumBinding.Clang.QBFile file, out ulong size) /// public void GetInclusions(nuint visitor, QuantumBinding.Clang.QBClientData client_data) { - var arg2 = client_data == null ? new CXClientDataImpl() : (CXClientDataImpl)client_data; + var arg2 = client_data == null ? new CXClientData() : (CXClientData)client_data; QuantumBinding.Clang.Interop.ClangInterop.clang_getInclusions(this, visitor, arg2); } @@ -326,7 +326,7 @@ public void GetInclusions(nuint visitor, QuantumBinding.Clang.QBClientData clien /// public QBSourceLocation GetLocation(QuantumBinding.Clang.QBFile file, uint line, uint column) { - var arg1 = file == null ? new CXFileImpl() : (CXFileImpl)file; + var arg1 = file == null ? new CXFile() : (CXFile)file; return QuantumBinding.Clang.Interop.ClangInterop.clang_getLocation(this, arg1, line, column); } @@ -335,7 +335,7 @@ public QBSourceLocation GetLocation(QuantumBinding.Clang.QBFile file, uint line, /// public QBSourceLocation GetLocationForOffset(QuantumBinding.Clang.QBFile file, uint offset) { - var arg1 = file == null ? new CXFileImpl() : (CXFileImpl)file; + var arg1 = file == null ? new CXFile() : (CXFile)file; return QuantumBinding.Clang.Interop.ClangInterop.clang_getLocationForOffset(this, arg1, offset); } @@ -344,7 +344,7 @@ public QBSourceLocation GetLocationForOffset(QuantumBinding.Clang.QBFile file, u /// public QBModule GetModuleForFile(QuantumBinding.Clang.QBFile param1) { - var arg1 = param1 == null ? new CXFileImpl() : (CXFileImpl)param1; + var arg1 = param1 == null ? new CXFile() : (CXFile)param1; return QuantumBinding.Clang.Interop.ClangInterop.clang_getModuleForFile(this, arg1); } @@ -361,7 +361,7 @@ public uint GetNumDiagnostics() /// public QBSourceRangeList GetSkippedRanges(QuantumBinding.Clang.QBFile file) { - var arg1 = file == null ? new CXFileImpl() : (CXFileImpl)file; + var arg1 = file == null ? new CXFile() : (CXFile)file; var result = QuantumBinding.Clang.Interop.ClangInterop.clang_getSkippedRanges(this, arg1); var wrappedResult = new QBSourceRangeList(*result); NativeUtils.Free(result); @@ -516,7 +516,7 @@ public QBTargetInfo GetTranslationUnitTargetInfo() /// public uint IsFileMultipleIncludeGuarded(QuantumBinding.Clang.QBFile file) { - var arg1 = file == null ? new CXFileImpl() : (CXFileImpl)file; + var arg1 = file == null ? new CXFile() : (CXFile)file; return QuantumBinding.Clang.Interop.ClangInterop.clang_isFileMultipleIncludeGuarded(this, arg1); } @@ -525,7 +525,7 @@ public uint IsFileMultipleIncludeGuarded(QuantumBinding.Clang.QBFile file) /// public uint Module_getNumTopLevelHeaders(QuantumBinding.Clang.QBModule module) { - var arg1 = module == null ? new CXModuleImpl() : (CXModuleImpl)module; + var arg1 = module == null ? new CXModule() : (CXModule)module; return QuantumBinding.Clang.Interop.ClangInterop.clang_Module_getNumTopLevelHeaders(this, arg1); } @@ -534,7 +534,7 @@ public uint Module_getNumTopLevelHeaders(QuantumBinding.Clang.QBModule module) /// public QBFile Module_getTopLevelHeader(QuantumBinding.Clang.QBModule module, uint index) { - var arg1 = module == null ? new CXModuleImpl() : (CXModuleImpl)module; + var arg1 = module == null ? new CXModule() : (CXModule)module; return QuantumBinding.Clang.Interop.ClangInterop.clang_Module_getTopLevelHeader(this, arg1, index); } diff --git a/QuantumBinding.Clang/Generated/Classes/QBVirtualFileOverlay.cs b/QuantumBinding.Clang/Generated/Classes/QBVirtualFileOverlay.cs index c3dd6d8..1106b21 100644 --- a/QuantumBinding.Clang/Generated/Classes/QBVirtualFileOverlay.cs +++ b/QuantumBinding.Clang/Generated/Classes/QBVirtualFileOverlay.cs @@ -80,9 +80,12 @@ public CXErrorCode VirtualFileOverlay_setCaseSensitivity(int caseSensitive) /// /// Write out the CXVirtualFileOverlay object to a char buffer. /// - public CXErrorCode VirtualFileOverlay_writeToBuffer(uint options, out sbyte* out_buffer_ptr, out uint out_buffer_size) + public CXErrorCode VirtualFileOverlay_writeToBuffer(uint options, out nuint out_buffer_ptr, out uint out_buffer_size) { - return QuantumBinding.Clang.Interop.ClangInterop.clang_VirtualFileOverlay_writeToBuffer(this, options, out out_buffer_ptr, out out_buffer_size); + sbyte* arg2 = null; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_VirtualFileOverlay_writeToBuffer(this, options, out arg2, out out_buffer_size); + out_buffer_ptr = (nuint)arg2; + return result; } public ref readonly CXVirtualFileOverlayImpl GetPinnableReference() => ref __Instance; diff --git a/QuantumBinding.Clang/Generated/Interop/Delegates/CXCursorVisitor.cs b/QuantumBinding.Clang/Generated/Interop/Delegates/CXCursorVisitor.cs index 1eb1b56..67dbda5 100644 --- a/QuantumBinding.Clang/Generated/Interop/Delegates/CXCursorVisitor.cs +++ b/QuantumBinding.Clang/Generated/Interop/Delegates/CXCursorVisitor.cs @@ -24,24 +24,24 @@ public CXCursorVisitor(nuint ptr) : this((void*) ptr) { } public CXCursorVisitor(void* ptr) { NativePointer = ptr; - InvokeFunc = (delegate* unmanaged)ptr; + InvokeFunc = (delegate* unmanaged)ptr; } - private delegate* unmanaged InvokeFunc; + private delegate* unmanaged InvokeFunc; public void* NativePointer { get; } - public CXChildVisitResult Invoke(QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXCursor parent, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public CXChildVisitResult Invoke(QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXCursor parent, QuantumBinding.Clang.Interop.CXClientData client_data) { return InvokeFunc(cursor, parent, client_data); } - public static CXChildVisitResult Invoke(void* ptr, QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXCursor parent, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public static CXChildVisitResult Invoke(void* ptr, QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXCursor parent, QuantumBinding.Clang.Interop.CXClientData client_data) { - return ((delegate* unmanaged)ptr)(cursor, parent, client_data); + return ((delegate* unmanaged)ptr)(cursor, parent, client_data); } - public static CXChildVisitResult Invoke(nuint ptr, QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXCursor parent, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public static CXChildVisitResult Invoke(nuint ptr, QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXCursor parent, QuantumBinding.Clang.Interop.CXClientData client_data) { - return ((delegate* unmanaged)(void*)ptr)(cursor, parent, client_data); + return ((delegate* unmanaged)(void*)ptr)(cursor, parent, client_data); } public static explicit operator CXCursorVisitor(void* ptr) => new(ptr); diff --git a/QuantumBinding.Clang/Generated/Interop/Delegates/CXFieldVisitor.cs b/QuantumBinding.Clang/Generated/Interop/Delegates/CXFieldVisitor.cs index 1078948..69dc119 100644 --- a/QuantumBinding.Clang/Generated/Interop/Delegates/CXFieldVisitor.cs +++ b/QuantumBinding.Clang/Generated/Interop/Delegates/CXFieldVisitor.cs @@ -24,24 +24,24 @@ public CXFieldVisitor(nuint ptr) : this((void*) ptr) { } public CXFieldVisitor(void* ptr) { NativePointer = ptr; - InvokeFunc = (delegate* unmanaged)ptr; + InvokeFunc = (delegate* unmanaged)ptr; } - private delegate* unmanaged InvokeFunc; + private delegate* unmanaged InvokeFunc; public void* NativePointer { get; } - public CXVisitorResult Invoke(QuantumBinding.Clang.Interop.CXCursor C, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public CXVisitorResult Invoke(QuantumBinding.Clang.Interop.CXCursor C, QuantumBinding.Clang.Interop.CXClientData client_data) { return InvokeFunc(C, client_data); } - public static CXVisitorResult Invoke(void* ptr, QuantumBinding.Clang.Interop.CXCursor C, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public static CXVisitorResult Invoke(void* ptr, QuantumBinding.Clang.Interop.CXCursor C, QuantumBinding.Clang.Interop.CXClientData client_data) { - return ((delegate* unmanaged)ptr)(C, client_data); + return ((delegate* unmanaged)ptr)(C, client_data); } - public static CXVisitorResult Invoke(nuint ptr, QuantumBinding.Clang.Interop.CXCursor C, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public static CXVisitorResult Invoke(nuint ptr, QuantumBinding.Clang.Interop.CXCursor C, QuantumBinding.Clang.Interop.CXClientData client_data) { - return ((delegate* unmanaged)(void*)ptr)(C, client_data); + return ((delegate* unmanaged)(void*)ptr)(C, client_data); } public static explicit operator CXFieldVisitor(void* ptr) => new(ptr); diff --git a/QuantumBinding.Clang/Generated/Interop/Delegates/CXInclusionVisitor.cs b/QuantumBinding.Clang/Generated/Interop/Delegates/CXInclusionVisitor.cs index 41e6ed6..c5de16f 100644 --- a/QuantumBinding.Clang/Generated/Interop/Delegates/CXInclusionVisitor.cs +++ b/QuantumBinding.Clang/Generated/Interop/Delegates/CXInclusionVisitor.cs @@ -24,24 +24,24 @@ public CXInclusionVisitor(nuint ptr) : this((void*) ptr) { } public CXInclusionVisitor(void* ptr) { NativePointer = ptr; - InvokeFunc = (delegate* unmanaged)ptr; + InvokeFunc = (delegate* unmanaged)ptr; } - private delegate* unmanaged InvokeFunc; + private delegate* unmanaged InvokeFunc; public void* NativePointer { get; } - public void Invoke(QuantumBinding.Clang.Interop.CXFileImpl included_file, QuantumBinding.Clang.Interop.CXSourceLocation* inclusion_stack, uint include_len, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public void Invoke(QuantumBinding.Clang.Interop.CXFile included_file, QuantumBinding.Clang.Interop.CXSourceLocation* inclusion_stack, uint include_len, QuantumBinding.Clang.Interop.CXClientData client_data) { InvokeFunc(included_file, inclusion_stack, include_len, client_data); } - public static void Invoke(void* ptr, QuantumBinding.Clang.Interop.CXFileImpl included_file, QuantumBinding.Clang.Interop.CXSourceLocation* inclusion_stack, uint include_len, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public static void Invoke(void* ptr, QuantumBinding.Clang.Interop.CXFile included_file, QuantumBinding.Clang.Interop.CXSourceLocation* inclusion_stack, uint include_len, QuantumBinding.Clang.Interop.CXClientData client_data) { - ((delegate* unmanaged)ptr)(included_file, inclusion_stack, include_len, client_data); + ((delegate* unmanaged)ptr)(included_file, inclusion_stack, include_len, client_data); } - public static void Invoke(nuint ptr, QuantumBinding.Clang.Interop.CXFileImpl included_file, QuantumBinding.Clang.Interop.CXSourceLocation* inclusion_stack, uint include_len, QuantumBinding.Clang.Interop.CXClientDataImpl client_data) + public static void Invoke(nuint ptr, QuantumBinding.Clang.Interop.CXFile included_file, QuantumBinding.Clang.Interop.CXSourceLocation* inclusion_stack, uint include_len, QuantumBinding.Clang.Interop.CXClientData client_data) { - ((delegate* unmanaged)(void*)ptr)(included_file, inclusion_stack, include_len, client_data); + ((delegate* unmanaged)(void*)ptr)(included_file, inclusion_stack, include_len, client_data); } public static explicit operator CXInclusionVisitor(void* ptr) => new(ptr); diff --git a/QuantumBinding.Clang/Generated/Interop/Functions/QuantumBinding.Clang.Functions.cs b/QuantumBinding.Clang/Generated/Interop/Functions/QuantumBinding.Clang.Functions.cs index c235fb4..d0c125a 100644 --- a/QuantumBinding.Clang/Generated/Interop/Functions/QuantumBinding.Clang.Functions.cs +++ b/QuantumBinding.Clang/Generated/Interop/Functions/QuantumBinding.Clang.Functions.cs @@ -76,7 +76,7 @@ public static unsafe partial class ClangInterop /// Retrieve a diagnostic associated with the given code completion. /// [DllImport(LibraryPath, EntryPoint = "clang_codeCompleteGetDiagnostic", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXDiagnosticImpl clang_codeCompleteGetDiagnostic(QuantumBinding.Clang.Interop.CXCodeCompleteResults* results, uint index); + internal static extern CXDiagnostic clang_codeCompleteGetDiagnostic(QuantumBinding.Clang.Interop.CXCodeCompleteResults* results, uint index); /// /// Determine the number of diagnostics produced prior to the location where code completion was performed. @@ -154,7 +154,7 @@ public static unsafe partial class ClangInterop /// Traverses the translation unit to create a CXAPISet. /// [DllImport(LibraryPath, EntryPoint = "clang_createAPISet", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXErrorCode clang_createAPISet(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, out QuantumBinding.Clang.Interop.CXAPISetImpl out_api); + internal static extern CXErrorCode clang_createAPISet(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXAPISetImpl* out_api); /// /// Creates an empty CXCursorSet. @@ -166,37 +166,37 @@ public static unsafe partial class ClangInterop /// Provides a shared context for creating translation units. /// [DllImport(LibraryPath, EntryPoint = "clang_createIndex", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXIndexImpl clang_createIndex(int excludeDeclarationsFromPCH, int displayDiagnostics); + internal static extern CXIndex clang_createIndex(int excludeDeclarationsFromPCH, int displayDiagnostics); /// /// Provides a shared context for creating translation units. /// [DllImport(LibraryPath, EntryPoint = "clang_createIndexWithOptions", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXIndexImpl clang_createIndexWithOptions(QuantumBinding.Clang.Interop.CXIndexOptions* options); + internal static extern CXIndex clang_createIndexWithOptions(QuantumBinding.Clang.Interop.CXIndexOptions* options); /// /// Same as clang_createTranslationUnit2, but returns the CXTranslationUnit instead of an error code. In case of an error this routine returns a NULL CXTranslationUnit, without further detailed error codes. /// [DllImport(LibraryPath, EntryPoint = "clang_createTranslationUnit", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXTranslationUnitImpl clang_createTranslationUnit(QuantumBinding.Clang.Interop.CXIndexImpl cIdx, sbyte* ast_filename); + internal static extern CXTranslationUnitImpl clang_createTranslationUnit(QuantumBinding.Clang.Interop.CXIndex cIdx, sbyte* ast_filename); /// /// Create a translation unit from an AST file ( -emit-ast). /// [DllImport(LibraryPath, EntryPoint = "clang_createTranslationUnit2", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXErrorCode clang_createTranslationUnit2(QuantumBinding.Clang.Interop.CXIndexImpl cIdx, sbyte* ast_filename, out QuantumBinding.Clang.Interop.CXTranslationUnitImpl out_TU); + internal static extern CXErrorCode clang_createTranslationUnit2(QuantumBinding.Clang.Interop.CXIndex cIdx, sbyte* ast_filename, QuantumBinding.Clang.Interop.CXTranslationUnitImpl* out_TU); /// /// Return the CXTranslationUnit for a given source file and the provided command line arguments one would pass to the compiler. /// [DllImport(LibraryPath, EntryPoint = "clang_createTranslationUnitFromSourceFile", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXTranslationUnitImpl clang_createTranslationUnitFromSourceFile(QuantumBinding.Clang.Interop.CXIndexImpl cIdx, sbyte* source_filename, int num_clang_command_line_args, sbyte** clang_command_line_args, uint num_unsaved_files, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files); + internal static extern CXTranslationUnitImpl clang_createTranslationUnitFromSourceFile(QuantumBinding.Clang.Interop.CXIndex cIdx, sbyte* source_filename, int num_clang_command_line_args, sbyte** clang_command_line_args, uint num_unsaved_files, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files); /// /// If cursor is a statement declaration tries to evaluate the statement and if its variable, tries to evaluate its initializer, into its corresponding type. If it's an expression, tries to evaluate the expression. /// [DllImport(LibraryPath, EntryPoint = "clang_Cursor_Evaluate", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXEvalResultImpl clang_Cursor_Evaluate(QuantumBinding.Clang.Interop.CXCursor c); + internal static extern CXEvalResult clang_Cursor_Evaluate(QuantumBinding.Clang.Interop.CXCursor c); /// /// Retrieve the argument cursor of a function or method. @@ -286,7 +286,7 @@ public static unsafe partial class ClangInterop /// Given a CXCursor_ModuleImportDecl cursor, return the associated module. /// [DllImport(LibraryPath, EntryPoint = "clang_Cursor_getModule", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXModuleImpl clang_Cursor_getModule(QuantumBinding.Clang.Interop.CXCursor c); + internal static extern CXModule clang_Cursor_getModule(QuantumBinding.Clang.Interop.CXCursor c); /// /// Retrieve the number of non-variadic arguments associated with a given cursor. @@ -454,7 +454,7 @@ public static unsafe partial class ClangInterop /// Returns non-zero if the given cursor points to a symbol marked with external_source_symbol attribute. /// [DllImport(LibraryPath, EntryPoint = "clang_Cursor_isExternalSymbol", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_Cursor_isExternalSymbol(QuantumBinding.Clang.Interop.CXCursor c, QuantumBinding.Clang.Interop.CXString* language, QuantumBinding.Clang.Interop.CXString* definedIn, uint* isGenerated); + internal static extern uint clang_Cursor_isExternalSymbol(QuantumBinding.Clang.Interop.CXCursor c, QuantumBinding.Clang.Interop.CXString* language, QuantumBinding.Clang.Interop.CXString* definedIn, ref uint isGenerated); /// /// Determine whether a CXCursor that is a function declaration, is an inline declaration. @@ -526,19 +526,19 @@ public static unsafe partial class ClangInterop /// Gets the general options associated with a CXIndex. /// [DllImport(LibraryPath, EntryPoint = "clang_CXIndex_getGlobalOptions", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_CXIndex_getGlobalOptions(QuantumBinding.Clang.Interop.CXIndexImpl param0); + internal static extern uint clang_CXIndex_getGlobalOptions(QuantumBinding.Clang.Interop.CXIndex param0); /// /// Sets general options associated with a CXIndex. /// [DllImport(LibraryPath, EntryPoint = "clang_CXIndex_setGlobalOptions", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_CXIndex_setGlobalOptions(QuantumBinding.Clang.Interop.CXIndexImpl param0, uint options); + internal static extern void clang_CXIndex_setGlobalOptions(QuantumBinding.Clang.Interop.CXIndex param0, uint options); /// /// Sets the invocation emission path option in a CXIndex. /// [DllImport(LibraryPath, EntryPoint = "clang_CXIndex_setInvocationEmissionPathOption", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_CXIndex_setInvocationEmissionPathOption(QuantumBinding.Clang.Interop.CXIndexImpl param0, sbyte* path); + internal static extern void clang_CXIndex_setInvocationEmissionPathOption(QuantumBinding.Clang.Interop.CXIndex param0, sbyte* path); /// /// Determine if a C++ constructor is a converting constructor. @@ -691,19 +691,19 @@ public static unsafe partial class ClangInterop /// Destroy a diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_disposeDiagnostic", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_disposeDiagnostic(QuantumBinding.Clang.Interop.CXDiagnosticImpl diagnostic); + internal static extern void clang_disposeDiagnostic(QuantumBinding.Clang.Interop.CXDiagnostic diagnostic); /// /// Release a CXDiagnosticSet and all of its contained diagnostics. /// [DllImport(LibraryPath, EntryPoint = "clang_disposeDiagnosticSet", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_disposeDiagnosticSet(QuantumBinding.Clang.Interop.CXDiagnosticSetImpl diags); + internal static extern void clang_disposeDiagnosticSet(QuantumBinding.Clang.Interop.CXDiagnosticSet diags); /// /// Destroy the given index. /// [DllImport(LibraryPath, EntryPoint = "clang_disposeIndex", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_disposeIndex(QuantumBinding.Clang.Interop.CXIndexImpl index); + internal static extern void clang_disposeIndex(QuantumBinding.Clang.Interop.CXIndex index); /// /// Free the set of overridden cursors returned by clang_getOverriddenCursors(). @@ -778,94 +778,94 @@ public static unsafe partial class ClangInterop /// Disposes the created Eval memory. /// [DllImport(LibraryPath, EntryPoint = "clang_EvalResult_dispose", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_EvalResult_dispose(QuantumBinding.Clang.Interop.CXEvalResultImpl e); + internal static extern void clang_EvalResult_dispose(QuantumBinding.Clang.Interop.CXEvalResult e); /// /// Returns the evaluation result as double if the kind is double. /// [DllImport(LibraryPath, EntryPoint = "clang_EvalResult_getAsDouble", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern double clang_EvalResult_getAsDouble(QuantumBinding.Clang.Interop.CXEvalResultImpl e); + internal static extern double clang_EvalResult_getAsDouble(QuantumBinding.Clang.Interop.CXEvalResult e); /// /// Returns the evaluation result as integer if the kind is Int. /// [DllImport(LibraryPath, EntryPoint = "clang_EvalResult_getAsInt", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern int clang_EvalResult_getAsInt(QuantumBinding.Clang.Interop.CXEvalResultImpl e); + internal static extern int clang_EvalResult_getAsInt(QuantumBinding.Clang.Interop.CXEvalResult e); /// /// Returns the evaluation result as a long long integer if the kind is Int. This prevents overflows that may happen if the result is returned with clang_EvalResult_getAsInt. /// [DllImport(LibraryPath, EntryPoint = "clang_EvalResult_getAsLongLong", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern long clang_EvalResult_getAsLongLong(QuantumBinding.Clang.Interop.CXEvalResultImpl e); + internal static extern long clang_EvalResult_getAsLongLong(QuantumBinding.Clang.Interop.CXEvalResult e); /// /// Returns the evaluation result as a constant string if the kind is other than Int or float. User must not free this pointer, instead call clang_EvalResult_dispose on the CXEvalResult returned by clang_Cursor_Evaluate. /// [DllImport(LibraryPath, EntryPoint = "clang_EvalResult_getAsStr", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern sbyte* clang_EvalResult_getAsStr(QuantumBinding.Clang.Interop.CXEvalResultImpl e); + internal static extern sbyte* clang_EvalResult_getAsStr(QuantumBinding.Clang.Interop.CXEvalResult e); /// /// Returns the evaluation result as an unsigned integer if the kind is Int and clang_EvalResult_isUnsignedInt is non-zero. /// [DllImport(LibraryPath, EntryPoint = "clang_EvalResult_getAsUnsigned", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern ulong clang_EvalResult_getAsUnsigned(QuantumBinding.Clang.Interop.CXEvalResultImpl e); + internal static extern ulong clang_EvalResult_getAsUnsigned(QuantumBinding.Clang.Interop.CXEvalResult e); /// /// Returns the kind of the evaluated result. /// [DllImport(LibraryPath, EntryPoint = "clang_EvalResult_getKind", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXEvalResultKind clang_EvalResult_getKind(QuantumBinding.Clang.Interop.CXEvalResultImpl e); + internal static extern CXEvalResultKind clang_EvalResult_getKind(QuantumBinding.Clang.Interop.CXEvalResult e); /// /// Returns a non-zero value if the kind is Int and the evaluation result resulted in an unsigned integer. /// [DllImport(LibraryPath, EntryPoint = "clang_EvalResult_isUnsignedInt", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_EvalResult_isUnsignedInt(QuantumBinding.Clang.Interop.CXEvalResultImpl e); + internal static extern uint clang_EvalResult_isUnsignedInt(QuantumBinding.Clang.Interop.CXEvalResult e); [DllImport(LibraryPath, EntryPoint = "clang_executeOnThread", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_executeOnThread(nuint fn, nuint user_data, uint stack_size); + internal static extern void clang_executeOnThread(void* fn, void* user_data, uint stack_size); /// /// Returns non-zero if the file1 and file2 point to the same file, or they are both NULL. /// [DllImport(LibraryPath, EntryPoint = "clang_File_isEqual", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern int clang_File_isEqual(QuantumBinding.Clang.Interop.CXFileImpl file1, QuantumBinding.Clang.Interop.CXFileImpl file2); + internal static extern int clang_File_isEqual(QuantumBinding.Clang.Interop.CXFile file1, QuantumBinding.Clang.Interop.CXFile file2); /// /// Returns the real path name of file. /// [DllImport(LibraryPath, EntryPoint = "clang_File_tryGetRealPathName", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_File_tryGetRealPathName(QuantumBinding.Clang.Interop.CXFileImpl file); + internal static extern CXString clang_File_tryGetRealPathName(QuantumBinding.Clang.Interop.CXFile file); /// /// Find #import/#include directives in a specific file. /// [DllImport(LibraryPath, EntryPoint = "clang_findIncludesInFile", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXResult clang_findIncludesInFile(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tU, QuantumBinding.Clang.Interop.CXFileImpl file, QuantumBinding.Clang.Interop.CXCursorAndRangeVisitor visitor); + internal static extern CXResult clang_findIncludesInFile(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tU, QuantumBinding.Clang.Interop.CXFile file, QuantumBinding.Clang.Interop.CXCursorAndRangeVisitor visitor); [DllImport(LibraryPath, EntryPoint = "clang_findIncludesInFileWithBlock", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXResult clang_findIncludesInFileWithBlock(QuantumBinding.Clang.Interop.CXTranslationUnitImpl param0, QuantumBinding.Clang.Interop.CXFileImpl param1, QuantumBinding.Clang.Interop._CXCursorAndRangeVisitorBlock param2); + internal static extern CXResult clang_findIncludesInFileWithBlock(QuantumBinding.Clang.Interop.CXTranslationUnitImpl param0, QuantumBinding.Clang.Interop.CXFile param1, QuantumBinding.Clang.Interop._CXCursorAndRangeVisitorBlock param2); /// /// Find references of a declaration in a specific file. /// [DllImport(LibraryPath, EntryPoint = "clang_findReferencesInFile", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXResult clang_findReferencesInFile(QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXFileImpl file, QuantumBinding.Clang.Interop.CXCursorAndRangeVisitor visitor); + internal static extern CXResult clang_findReferencesInFile(QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXFile file, QuantumBinding.Clang.Interop.CXCursorAndRangeVisitor visitor); [DllImport(LibraryPath, EntryPoint = "clang_findReferencesInFileWithBlock", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXResult clang_findReferencesInFileWithBlock(QuantumBinding.Clang.Interop.CXCursor param0, QuantumBinding.Clang.Interop.CXFileImpl param1, QuantumBinding.Clang.Interop._CXCursorAndRangeVisitorBlock param2); + internal static extern CXResult clang_findReferencesInFileWithBlock(QuantumBinding.Clang.Interop.CXCursor param0, QuantumBinding.Clang.Interop.CXFile param1, QuantumBinding.Clang.Interop._CXCursorAndRangeVisitorBlock param2); /// /// Format the given diagnostic in a manner that is suitable for display. /// [DllImport(LibraryPath, EntryPoint = "clang_formatDiagnostic", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_formatDiagnostic(QuantumBinding.Clang.Interop.CXDiagnosticImpl diagnostic, uint options); + internal static extern CXString clang_formatDiagnostic(QuantumBinding.Clang.Interop.CXDiagnostic diagnostic, uint options); /// /// free memory allocated by libclang, such as the buffer returned by CXVirtualFileOverlay() or clang_ModuleMapDescriptor_writeToBuffer(). /// [DllImport(LibraryPath, EntryPoint = "clang_free", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_free(nuint buffer); + internal static extern void clang_free(void* buffer); /// /// Convert a given full parsed comment to an HTML fragment. @@ -937,7 +937,7 @@ public static unsafe partial class ClangInterop /// Retrieve the child diagnostics of a CXDiagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getChildDiagnostics", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXDiagnosticSetImpl clang_getChildDiagnostics(QuantumBinding.Clang.Interop.CXDiagnosticImpl d); + internal static extern CXDiagnosticSet clang_getChildDiagnostics(QuantumBinding.Clang.Interop.CXDiagnostic d); /// /// Return a version string, suitable for showing to a user, but not intended to be parsed (the format is not guaranteed to be stable). @@ -949,37 +949,37 @@ public static unsafe partial class ClangInterop /// Retrieve the annotation associated with the given completion string. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionAnnotation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getCompletionAnnotation(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string, uint annotation_number); + internal static extern CXString clang_getCompletionAnnotation(QuantumBinding.Clang.Interop.CXCompletionString completion_string, uint annotation_number); /// /// Determine the availability of the entity that this code-completion string refers to. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionAvailability", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXAvailabilityKind clang_getCompletionAvailability(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string); + internal static extern CXAvailabilityKind clang_getCompletionAvailability(QuantumBinding.Clang.Interop.CXCompletionString completion_string); /// /// Retrieve the brief documentation comment attached to the declaration that corresponds to the given completion string. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionBriefComment", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getCompletionBriefComment(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string); + internal static extern CXString clang_getCompletionBriefComment(QuantumBinding.Clang.Interop.CXCompletionString completion_string); /// /// Retrieve the completion string associated with a particular chunk within a completion string. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionChunkCompletionString", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXCompletionStringImpl clang_getCompletionChunkCompletionString(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string, uint chunk_number); + internal static extern CXCompletionString clang_getCompletionChunkCompletionString(QuantumBinding.Clang.Interop.CXCompletionString completion_string, uint chunk_number); /// /// Determine the kind of a particular chunk within a completion string. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionChunkKind", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXCompletionChunkKind clang_getCompletionChunkKind(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string, uint chunk_number); + internal static extern CXCompletionChunkKind clang_getCompletionChunkKind(QuantumBinding.Clang.Interop.CXCompletionString completion_string, uint chunk_number); /// /// Retrieve the text associated with a particular chunk within a completion string. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionChunkText", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getCompletionChunkText(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string, uint chunk_number); + internal static extern CXString clang_getCompletionChunkText(QuantumBinding.Clang.Interop.CXCompletionString completion_string, uint chunk_number); /// /// Fix-its that *must* be applied before inserting the text for the corresponding completion. @@ -991,7 +991,7 @@ public static unsafe partial class ClangInterop /// Retrieve the number of annotations associated with the given completion string. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionNumAnnotations", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_getCompletionNumAnnotations(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string); + internal static extern uint clang_getCompletionNumAnnotations(QuantumBinding.Clang.Interop.CXCompletionString completion_string); /// /// Retrieve the number of fix-its for the given completion index. @@ -1003,13 +1003,13 @@ public static unsafe partial class ClangInterop /// Retrieve the parent context of the given completion string. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionParent", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getCompletionParent(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string, CXCursorKind* kind); + internal static extern CXString clang_getCompletionParent(QuantumBinding.Clang.Interop.CXCompletionString completion_string, CXCursorKind* kind); /// /// Determine the priority of this code completion. /// [DllImport(LibraryPath, EntryPoint = "clang_getCompletionPriority", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_getCompletionPriority(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string); + internal static extern uint clang_getCompletionPriority(QuantumBinding.Clang.Interop.CXCompletionString completion_string); /// /// Retrieve the character data associated with the given string. @@ -1039,7 +1039,7 @@ public static unsafe partial class ClangInterop /// Retrieve a completion string for an arbitrary declaration or macro definition cursor. /// [DllImport(LibraryPath, EntryPoint = "clang_getCursorCompletionString", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXCompletionStringImpl clang_getCursorCompletionString(QuantumBinding.Clang.Interop.CXCursor cursor); + internal static extern CXCompletionString clang_getCursorCompletionString(QuantumBinding.Clang.Interop.CXCursor cursor); /// /// For a cursor that is either a reference to or a declaration of some entity, retrieve a cursor that describes the definition of that entity. @@ -1105,19 +1105,19 @@ public static unsafe partial class ClangInterop /// Determine the availability of the entity that this cursor refers to on any platforms for which availability information is known. /// [DllImport(LibraryPath, EntryPoint = "clang_getCursorPlatformAvailability", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern int clang_getCursorPlatformAvailability(QuantumBinding.Clang.Interop.CXCursor cursor, int* always_deprecated, QuantumBinding.Clang.Interop.CXString* deprecated_message, int* always_unavailable, QuantumBinding.Clang.Interop.CXString* unavailable_message, QuantumBinding.Clang.Interop.CXPlatformAvailability* availability, int availability_size); + internal static extern int clang_getCursorPlatformAvailability(QuantumBinding.Clang.Interop.CXCursor cursor, int* always_deprecated, QuantumBinding.Clang.Interop.CXString* deprecated_message, ref int always_unavailable, QuantumBinding.Clang.Interop.CXString* unavailable_message, QuantumBinding.Clang.Interop.CXPlatformAvailability* availability, int availability_size); /// /// Pretty print declarations. /// [DllImport(LibraryPath, EntryPoint = "clang_getCursorPrettyPrinted", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getCursorPrettyPrinted(QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXPrintingPolicyImpl policy); + internal static extern CXString clang_getCursorPrettyPrinted(QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXPrintingPolicy policy); /// /// Retrieve the default policy for the cursor. /// [DllImport(LibraryPath, EntryPoint = "clang_getCursorPrintingPolicy", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXPrintingPolicyImpl clang_getCursorPrintingPolicy(QuantumBinding.Clang.Interop.CXCursor param0); + internal static extern CXPrintingPolicy clang_getCursorPrintingPolicy(QuantumBinding.Clang.Interop.CXCursor param0); /// /// For a cursor that is a reference, retrieve a cursor representing the entity that it references. @@ -1198,19 +1198,19 @@ public static unsafe partial class ClangInterop internal static extern CXString clang_getDeclObjCTypeEncoding(QuantumBinding.Clang.Interop.CXCursor c); [DllImport(LibraryPath, EntryPoint = "clang_getDefinitionSpellingAndExtent", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_getDefinitionSpellingAndExtent(QuantumBinding.Clang.Interop.CXCursor param0, sbyte** startBuf, sbyte** endBuf, uint* startLine, uint* startColumn, uint* endLine, uint* endColumn); + internal static extern void clang_getDefinitionSpellingAndExtent(QuantumBinding.Clang.Interop.CXCursor param0, sbyte** startBuf, sbyte** endBuf, ref uint startLine, ref uint startColumn, ref uint endLine, ref uint endColumn); /// /// Retrieve a diagnostic associated with the given translation unit. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnostic", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXDiagnosticImpl clang_getDiagnostic(QuantumBinding.Clang.Interop.CXTranslationUnitImpl unit, uint index); + internal static extern CXDiagnostic clang_getDiagnostic(QuantumBinding.Clang.Interop.CXTranslationUnitImpl unit, uint index); /// /// Retrieve the category number for this diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticCategory", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_getDiagnosticCategory(QuantumBinding.Clang.Interop.CXDiagnosticImpl param0); + internal static extern uint clang_getDiagnosticCategory(QuantumBinding.Clang.Interop.CXDiagnostic param0); /// /// Retrieve the name of a particular diagnostic category. This is now deprecated. Use clang_getDiagnosticCategoryText() instead. @@ -1222,67 +1222,67 @@ public static unsafe partial class ClangInterop /// Retrieve the diagnostic category text for a given diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticCategoryText", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getDiagnosticCategoryText(QuantumBinding.Clang.Interop.CXDiagnosticImpl param0); + internal static extern CXString clang_getDiagnosticCategoryText(QuantumBinding.Clang.Interop.CXDiagnostic param0); /// /// Retrieve the replacement information for a given fix-it. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticFixIt", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getDiagnosticFixIt(QuantumBinding.Clang.Interop.CXDiagnosticImpl diagnostic, uint fixIt, QuantumBinding.Clang.Interop.CXSourceRange* replacementRange); + internal static extern CXString clang_getDiagnosticFixIt(QuantumBinding.Clang.Interop.CXDiagnostic diagnostic, uint fixIt, QuantumBinding.Clang.Interop.CXSourceRange* replacementRange); /// /// Retrieve a diagnostic associated with the given CXDiagnosticSet. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticInSet", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXDiagnosticImpl clang_getDiagnosticInSet(QuantumBinding.Clang.Interop.CXDiagnosticSetImpl diags, uint index); + internal static extern CXDiagnostic clang_getDiagnosticInSet(QuantumBinding.Clang.Interop.CXDiagnosticSet diags, uint index); /// /// Retrieve the source location of the given diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticLocation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXSourceLocation clang_getDiagnosticLocation(QuantumBinding.Clang.Interop.CXDiagnosticImpl param0); + internal static extern CXSourceLocation clang_getDiagnosticLocation(QuantumBinding.Clang.Interop.CXDiagnostic param0); /// /// Determine the number of fix-it hints associated with the given diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticNumFixIts", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_getDiagnosticNumFixIts(QuantumBinding.Clang.Interop.CXDiagnosticImpl diagnostic); + internal static extern uint clang_getDiagnosticNumFixIts(QuantumBinding.Clang.Interop.CXDiagnostic diagnostic); /// /// Determine the number of source ranges associated with the given diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticNumRanges", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_getDiagnosticNumRanges(QuantumBinding.Clang.Interop.CXDiagnosticImpl param0); + internal static extern uint clang_getDiagnosticNumRanges(QuantumBinding.Clang.Interop.CXDiagnostic param0); /// /// Retrieve the name of the command-line option that enabled this diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticOption", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getDiagnosticOption(QuantumBinding.Clang.Interop.CXDiagnosticImpl diag, QuantumBinding.Clang.Interop.CXString* disable); + internal static extern CXString clang_getDiagnosticOption(QuantumBinding.Clang.Interop.CXDiagnostic diag, QuantumBinding.Clang.Interop.CXString* disable); /// /// Retrieve a source range associated with the diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticRange", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXSourceRange clang_getDiagnosticRange(QuantumBinding.Clang.Interop.CXDiagnosticImpl diagnostic, uint range); + internal static extern CXSourceRange clang_getDiagnosticRange(QuantumBinding.Clang.Interop.CXDiagnostic diagnostic, uint range); /// /// Retrieve the complete set of diagnostics associated with a translation unit. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticSetFromTU", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXDiagnosticSetImpl clang_getDiagnosticSetFromTU(QuantumBinding.Clang.Interop.CXTranslationUnitImpl unit); + internal static extern CXDiagnosticSet clang_getDiagnosticSetFromTU(QuantumBinding.Clang.Interop.CXTranslationUnitImpl unit); /// /// Determine the severity of the given diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticSeverity", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXDiagnosticSeverity clang_getDiagnosticSeverity(QuantumBinding.Clang.Interop.CXDiagnosticImpl param0); + internal static extern CXDiagnosticSeverity clang_getDiagnosticSeverity(QuantumBinding.Clang.Interop.CXDiagnostic param0); /// /// Retrieve the text of the given diagnostic. /// [DllImport(LibraryPath, EntryPoint = "clang_getDiagnosticSpelling", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getDiagnosticSpelling(QuantumBinding.Clang.Interop.CXDiagnosticImpl param0); + internal static extern CXString clang_getDiagnosticSpelling(QuantumBinding.Clang.Interop.CXDiagnostic param0); /// /// Return the element type of an array, complex, or vector type. @@ -1318,7 +1318,7 @@ public static unsafe partial class ClangInterop /// Retrieve the file, line, column, and offset represented by the given source location. /// [DllImport(LibraryPath, EntryPoint = "clang_getExpansionLocation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_getExpansionLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, out QuantumBinding.Clang.Interop.CXFileImpl file, out uint line, out uint column, out uint offset); + internal static extern void clang_getExpansionLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, QuantumBinding.Clang.Interop.CXFile* file, out uint line, out uint column, out uint offset); /// /// Retrieve the bit width of a bit-field declaration as an integer. @@ -1330,43 +1330,43 @@ public static unsafe partial class ClangInterop /// Retrieve a file handle within the given translation unit. /// [DllImport(LibraryPath, EntryPoint = "clang_getFile", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXFileImpl clang_getFile(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, sbyte* file_name); + internal static extern CXFile clang_getFile(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, sbyte* file_name); /// /// Retrieve the buffer associated with the given file. /// [DllImport(LibraryPath, EntryPoint = "clang_getFileContents", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern sbyte* clang_getFileContents(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFileImpl file, out ulong size); + internal static extern sbyte* clang_getFileContents(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFile file, out ulong size); /// /// Retrieve the file, line, column, and offset represented by the given source location. /// [DllImport(LibraryPath, EntryPoint = "clang_getFileLocation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_getFileLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, out QuantumBinding.Clang.Interop.CXFileImpl file, out uint line, out uint column, out uint offset); + internal static extern void clang_getFileLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, QuantumBinding.Clang.Interop.CXFile* file, out uint line, out uint column, out uint offset); /// /// Retrieve the complete file and path name of the given file. /// [DllImport(LibraryPath, EntryPoint = "clang_getFileName", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getFileName(QuantumBinding.Clang.Interop.CXFileImpl sFile); + internal static extern CXString clang_getFileName(QuantumBinding.Clang.Interop.CXFile sFile); /// /// Retrieve the last modification time of the given file. /// [DllImport(LibraryPath, EntryPoint = "clang_getFileTime", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern long clang_getFileTime(QuantumBinding.Clang.Interop.CXFileImpl sFile); + internal static extern long clang_getFileTime(QuantumBinding.Clang.Interop.CXFile sFile); /// /// Retrieve the unique ID for the given file. /// [DllImport(LibraryPath, EntryPoint = "clang_getFileUniqueID", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern int clang_getFileUniqueID(QuantumBinding.Clang.Interop.CXFileImpl file, out QuantumBinding.Clang.Interop.CXFileUniqueID outID); + internal static extern int clang_getFileUniqueID(QuantumBinding.Clang.Interop.CXFile file, QuantumBinding.Clang.Interop.CXFileUniqueID* outID); /// /// Get the fully qualified name for a type. /// [DllImport(LibraryPath, EntryPoint = "clang_getFullyQualifiedName", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getFullyQualifiedName(QuantumBinding.Clang.Interop.CXType cT, QuantumBinding.Clang.Interop.CXPrintingPolicyImpl policy, uint withGlobalNsPrefix); + internal static extern CXString clang_getFullyQualifiedName(QuantumBinding.Clang.Interop.CXType cT, QuantumBinding.Clang.Interop.CXPrintingPolicy policy, uint withGlobalNsPrefix); /// /// Retrieve the calling convention associated with a function type. @@ -1384,37 +1384,37 @@ public static unsafe partial class ClangInterop /// Retrieve the file that is included by the given inclusion directive cursor. /// [DllImport(LibraryPath, EntryPoint = "clang_getIncludedFile", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXFileImpl clang_getIncludedFile(QuantumBinding.Clang.Interop.CXCursor cursor); + internal static extern CXFile clang_getIncludedFile(QuantumBinding.Clang.Interop.CXCursor cursor); /// /// Visit the set of preprocessor inclusions in a translation unit. The visitor function is called with the provided data for every included file. This does not include headers included by the PCH file (unless one is inspecting the inclusions in the PCH file itself). /// [DllImport(LibraryPath, EntryPoint = "clang_getInclusions", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_getInclusions(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, nuint visitor, QuantumBinding.Clang.Interop.CXClientDataImpl client_data); + internal static extern void clang_getInclusions(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, nuint visitor, QuantumBinding.Clang.Interop.CXClientData client_data); /// /// Legacy API to retrieve the file, line, column, and offset represented by the given source location. /// [DllImport(LibraryPath, EntryPoint = "clang_getInstantiationLocation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_getInstantiationLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, out QuantumBinding.Clang.Interop.CXFileImpl file, out uint line, out uint column, out uint offset); + internal static extern void clang_getInstantiationLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, QuantumBinding.Clang.Interop.CXFile* file, out uint line, out uint column, out uint offset); /// /// Retrieves the source location associated with a given file/line/column in a particular translation unit. /// [DllImport(LibraryPath, EntryPoint = "clang_getLocation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXSourceLocation clang_getLocation(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFileImpl file, uint line, uint column); + internal static extern CXSourceLocation clang_getLocation(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFile file, uint line, uint column); /// /// Retrieves the source location associated with a given character offset in a particular translation unit. /// [DllImport(LibraryPath, EntryPoint = "clang_getLocationForOffset", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXSourceLocation clang_getLocationForOffset(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFileImpl file, uint offset); + internal static extern CXSourceLocation clang_getLocationForOffset(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFile file, uint offset); /// /// Given a CXFile header file, return the module that contains it, if one exists. /// [DllImport(LibraryPath, EntryPoint = "clang_getModuleForFile", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXModuleImpl clang_getModuleForFile(QuantumBinding.Clang.Interop.CXTranslationUnitImpl param0, QuantumBinding.Clang.Interop.CXFileImpl param1); + internal static extern CXModule clang_getModuleForFile(QuantumBinding.Clang.Interop.CXTranslationUnitImpl param0, QuantumBinding.Clang.Interop.CXFile param1); /// /// For reference types (e.g., "const int&"), returns the type that the reference refers to (e.g "const int"). @@ -1450,7 +1450,7 @@ public static unsafe partial class ClangInterop /// Retrieve the number of chunks in the given code-completion string. /// [DllImport(LibraryPath, EntryPoint = "clang_getNumCompletionChunks", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_getNumCompletionChunks(QuantumBinding.Clang.Interop.CXCompletionStringImpl completion_string); + internal static extern uint clang_getNumCompletionChunks(QuantumBinding.Clang.Interop.CXCompletionString completion_string); /// /// Determine the number of diagnostics produced for the given translation unit. @@ -1462,7 +1462,7 @@ public static unsafe partial class ClangInterop /// Determine the number of diagnostics in a CXDiagnosticSet. /// [DllImport(LibraryPath, EntryPoint = "clang_getNumDiagnosticsInSet", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_getNumDiagnosticsInSet(QuantumBinding.Clang.Interop.CXDiagnosticSetImpl diags); + internal static extern uint clang_getNumDiagnosticsInSet(QuantumBinding.Clang.Interop.CXDiagnosticSet diags); /// /// Return the number of elements of an array or vector type. @@ -1504,7 +1504,7 @@ public static unsafe partial class ClangInterop /// Retrieve the file, line and column represented by the given source location, as specified in a # line directive. /// [DllImport(LibraryPath, EntryPoint = "clang_getPresumedLocation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_getPresumedLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, out QuantumBinding.Clang.Interop.CXString filename, out uint line, out uint column); + internal static extern void clang_getPresumedLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, QuantumBinding.Clang.Interop.CXString* filename, out uint line, out uint column); /// /// Retrieve a source range given the beginning and ending source locations. @@ -1525,10 +1525,10 @@ public static unsafe partial class ClangInterop internal static extern CXSourceLocation clang_getRangeStart(QuantumBinding.Clang.Interop.CXSourceRange range); [DllImport(LibraryPath, EntryPoint = "clang_getRemappings", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXRemappingImpl clang_getRemappings(sbyte* param0); + internal static extern CXRemapping clang_getRemappings(sbyte* param0); [DllImport(LibraryPath, EntryPoint = "clang_getRemappingsFromFileList", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXRemappingImpl clang_getRemappingsFromFileList(sbyte** param0, uint param1); + internal static extern CXRemapping clang_getRemappingsFromFileList(sbyte** param0, uint param1); /// /// Retrieve the return type associated with a function type. @@ -1540,7 +1540,7 @@ public static unsafe partial class ClangInterop /// Retrieve all ranges that were skipped by the preprocessor. /// [DllImport(LibraryPath, EntryPoint = "clang_getSkippedRanges", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXSourceRangeList* clang_getSkippedRanges(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFileImpl file); + internal static extern CXSourceRangeList* clang_getSkippedRanges(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFile file); /// /// Given a cursor that may represent a specialization or instantiation of a template, retrieve the cursor that represents the template that it specializes or from which it was instantiated. @@ -1552,7 +1552,7 @@ public static unsafe partial class ClangInterop /// Retrieve the file, line, column, and offset represented by the given source location. /// [DllImport(LibraryPath, EntryPoint = "clang_getSpellingLocation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_getSpellingLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, out QuantumBinding.Clang.Interop.CXFileImpl file, out uint line, out uint column, out uint offset); + internal static extern void clang_getSpellingLocation(QuantumBinding.Clang.Interop.CXSourceLocation location, QuantumBinding.Clang.Interop.CXFile* file, out uint line, out uint column, out uint offset); /// /// Generate a single symbol symbol graph for the declaration at the given cursor. Returns a null string if the AST node for the cursor isn't a declaration. @@ -1654,7 +1654,7 @@ public static unsafe partial class ClangInterop /// Pretty-print the underlying type using a custom printing policy. /// [DllImport(LibraryPath, EntryPoint = "clang_getTypePrettyPrinted", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_getTypePrettyPrinted(QuantumBinding.Clang.Interop.CXType cT, QuantumBinding.Clang.Interop.CXPrintingPolicyImpl cxPolicy); + internal static extern CXString clang_getTypePrettyPrinted(QuantumBinding.Clang.Interop.CXType cT, QuantumBinding.Clang.Interop.CXPrintingPolicy cxPolicy); /// /// Pretty-print the underlying type using the rules of the language of the translation unit from which it came. @@ -1720,13 +1720,13 @@ public static unsafe partial class ClangInterop /// For retrieving a custom CXIdxClientContainer attached to a container. /// [DllImport(LibraryPath, EntryPoint = "clang_index_getClientContainer", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXIdxClientContainerImpl clang_index_getClientContainer(QuantumBinding.Clang.Interop.CXIdxContainerInfo* param0); + internal static extern CXIdxClientContainer clang_index_getClientContainer(QuantumBinding.Clang.Interop.CXIdxContainerInfo* param0); /// /// For retrieving a custom CXIdxClientEntity attached to an entity. /// [DllImport(LibraryPath, EntryPoint = "clang_index_getClientEntity", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXIdxClientEntityImpl clang_index_getClientEntity(QuantumBinding.Clang.Interop.CXIdxEntityInfo* param0); + internal static extern CXIdxClientEntity clang_index_getClientEntity(QuantumBinding.Clang.Interop.CXIdxEntityInfo* param0); [DllImport(LibraryPath, EntryPoint = "clang_index_getCXXClassDeclInfo", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] internal static extern CXIdxCXXClassDeclInfo* clang_index_getCXXClassDeclInfo(QuantumBinding.Clang.Interop.CXIdxDeclInfo* param0); @@ -1756,25 +1756,25 @@ public static unsafe partial class ClangInterop /// For setting a custom CXIdxClientContainer attached to a container. /// [DllImport(LibraryPath, EntryPoint = "clang_index_setClientContainer", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_index_setClientContainer(QuantumBinding.Clang.Interop.CXIdxContainerInfo* param0, QuantumBinding.Clang.Interop.CXIdxClientContainerImpl param1); + internal static extern void clang_index_setClientContainer(QuantumBinding.Clang.Interop.CXIdxContainerInfo* param0, QuantumBinding.Clang.Interop.CXIdxClientContainer param1); /// /// For setting a custom CXIdxClientEntity attached to an entity. /// [DllImport(LibraryPath, EntryPoint = "clang_index_setClientEntity", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_index_setClientEntity(QuantumBinding.Clang.Interop.CXIdxEntityInfo* param0, QuantumBinding.Clang.Interop.CXIdxClientEntityImpl param1); + internal static extern void clang_index_setClientEntity(QuantumBinding.Clang.Interop.CXIdxEntityInfo* param0, QuantumBinding.Clang.Interop.CXIdxClientEntity param1); /// /// An indexing action/session, to be applied to one or multiple translation units. /// [DllImport(LibraryPath, EntryPoint = "clang_IndexAction_create", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXIndexActionImpl clang_IndexAction_create(QuantumBinding.Clang.Interop.CXIndexImpl cIdx); + internal static extern CXIndexAction clang_IndexAction_create(QuantumBinding.Clang.Interop.CXIndex cIdx); /// /// Destroy the given index action. /// [DllImport(LibraryPath, EntryPoint = "clang_IndexAction_dispose", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_IndexAction_dispose(QuantumBinding.Clang.Interop.CXIndexActionImpl param0); + internal static extern void clang_IndexAction_dispose(QuantumBinding.Clang.Interop.CXIndexAction param0); /// /// Retrieve the CXSourceLocation represented by the given CXIdxLoc. @@ -1786,25 +1786,25 @@ public static unsafe partial class ClangInterop /// Retrieve the CXIdxFile, file, line, column, and offset represented by the given CXIdxLoc. /// [DllImport(LibraryPath, EntryPoint = "clang_indexLoc_getFileLocation", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_indexLoc_getFileLocation(QuantumBinding.Clang.Interop.CXIdxLoc loc, out QuantumBinding.Clang.Interop.CXIdxClientFileImpl indexFile, out QuantumBinding.Clang.Interop.CXFileImpl file, out uint line, out uint column, out uint offset); + internal static extern void clang_indexLoc_getFileLocation(QuantumBinding.Clang.Interop.CXIdxLoc loc, QuantumBinding.Clang.Interop.CXIdxClientFile* indexFile, QuantumBinding.Clang.Interop.CXFile* file, out uint line, out uint column, out uint offset); /// /// Index the given source file and the translation unit corresponding to that file via callbacks implemented through #IndexerCallbacks. /// [DllImport(LibraryPath, EntryPoint = "clang_indexSourceFile", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern int clang_indexSourceFile(QuantumBinding.Clang.Interop.CXIndexActionImpl param0, QuantumBinding.Clang.Interop.CXClientDataImpl client_data, QuantumBinding.Clang.Interop.IndexerCallbacks* index_callbacks, uint index_callbacks_size, uint index_options, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, out QuantumBinding.Clang.Interop.CXTranslationUnitImpl out_TU, uint tU_options); + internal static extern int clang_indexSourceFile(QuantumBinding.Clang.Interop.CXIndexAction param0, QuantumBinding.Clang.Interop.CXClientData client_data, QuantumBinding.Clang.Interop.IndexerCallbacks* index_callbacks, uint index_callbacks_size, uint index_options, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, QuantumBinding.Clang.Interop.CXTranslationUnitImpl* out_TU, uint tU_options); /// /// Same as clang_indexSourceFile but requires a full command line for command_line_args including argv[0]. This is useful if the standard library paths are relative to the binary. /// [DllImport(LibraryPath, EntryPoint = "clang_indexSourceFileFullArgv", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern int clang_indexSourceFileFullArgv(QuantumBinding.Clang.Interop.CXIndexActionImpl param0, QuantumBinding.Clang.Interop.CXClientDataImpl client_data, QuantumBinding.Clang.Interop.IndexerCallbacks* index_callbacks, uint index_callbacks_size, uint index_options, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, out QuantumBinding.Clang.Interop.CXTranslationUnitImpl out_TU, uint tU_options); + internal static extern int clang_indexSourceFileFullArgv(QuantumBinding.Clang.Interop.CXIndexAction param0, QuantumBinding.Clang.Interop.CXClientData client_data, QuantumBinding.Clang.Interop.IndexerCallbacks* index_callbacks, uint index_callbacks_size, uint index_options, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, QuantumBinding.Clang.Interop.CXTranslationUnitImpl* out_TU, uint tU_options); /// /// Index the given translation unit via callbacks implemented through #IndexerCallbacks. /// [DllImport(LibraryPath, EntryPoint = "clang_indexTranslationUnit", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern int clang_indexTranslationUnit(QuantumBinding.Clang.Interop.CXIndexActionImpl param0, QuantumBinding.Clang.Interop.CXClientDataImpl client_data, QuantumBinding.Clang.Interop.IndexerCallbacks* index_callbacks, uint index_callbacks_size, uint index_options, QuantumBinding.Clang.Interop.CXTranslationUnitImpl param5); + internal static extern int clang_indexTranslationUnit(QuantumBinding.Clang.Interop.CXIndexAction param0, QuantumBinding.Clang.Interop.CXClientData client_data, QuantumBinding.Clang.Interop.IndexerCallbacks* index_callbacks, uint index_callbacks_size, uint index_options, QuantumBinding.Clang.Interop.CXTranslationUnitImpl param5); /// /// Returns text of the specified argument. @@ -1876,7 +1876,7 @@ public static unsafe partial class ClangInterop /// Determine whether the given header is guarded against multiple inclusions, either with the conventional #ifndef/#define/#endif macro guards or with #pragma once. /// [DllImport(LibraryPath, EntryPoint = "clang_isFileMultipleIncludeGuarded", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_isFileMultipleIncludeGuarded(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFileImpl file); + internal static extern uint clang_isFileMultipleIncludeGuarded(QuantumBinding.Clang.Interop.CXTranslationUnitImpl tu, QuantumBinding.Clang.Interop.CXFile file); /// /// Return 1 if the CXType is a variadic function type, and 0 otherwise. @@ -1954,7 +1954,7 @@ public static unsafe partial class ClangInterop /// Deserialize a set of diagnostics from a Clang diagnostics bitcode file. /// [DllImport(LibraryPath, EntryPoint = "clang_loadDiagnostics", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXDiagnosticSetImpl clang_loadDiagnostics(sbyte* file, out CXLoadDiag_Error error, out QuantumBinding.Clang.Interop.CXString errorString); + internal static extern CXDiagnosticSet clang_loadDiagnostics(sbyte* file, CXLoadDiag_Error* error, QuantumBinding.Clang.Interop.CXString* errorString); /// /// Returns non-zero if the given source location is in the main file of the corresponding translation unit. @@ -1972,43 +1972,43 @@ public static unsafe partial class ClangInterop /// Returns the module file where the provided module object came from. /// [DllImport(LibraryPath, EntryPoint = "clang_Module_getASTFile", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXFileImpl clang_Module_getASTFile(QuantumBinding.Clang.Interop.CXModuleImpl module); + internal static extern CXFile clang_Module_getASTFile(QuantumBinding.Clang.Interop.CXModule module); /// /// Returns the full name of the module, e.g. "std.vector". /// [DllImport(LibraryPath, EntryPoint = "clang_Module_getFullName", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_Module_getFullName(QuantumBinding.Clang.Interop.CXModuleImpl module); + internal static extern CXString clang_Module_getFullName(QuantumBinding.Clang.Interop.CXModule module); /// /// Returns the name of the module, e.g. for the 'std.vector' sub-module it will return "vector". /// [DllImport(LibraryPath, EntryPoint = "clang_Module_getName", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXString clang_Module_getName(QuantumBinding.Clang.Interop.CXModuleImpl module); + internal static extern CXString clang_Module_getName(QuantumBinding.Clang.Interop.CXModule module); /// /// Returns the number of top level headers associated with this module. /// [DllImport(LibraryPath, EntryPoint = "clang_Module_getNumTopLevelHeaders", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_Module_getNumTopLevelHeaders(QuantumBinding.Clang.Interop.CXTranslationUnitImpl param0, QuantumBinding.Clang.Interop.CXModuleImpl module); + internal static extern uint clang_Module_getNumTopLevelHeaders(QuantumBinding.Clang.Interop.CXTranslationUnitImpl param0, QuantumBinding.Clang.Interop.CXModule module); /// /// Returns the parent of a sub-module or NULL if the given module is top-level, e.g. for 'std.vector' it will return the 'std' module. /// [DllImport(LibraryPath, EntryPoint = "clang_Module_getParent", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXModuleImpl clang_Module_getParent(QuantumBinding.Clang.Interop.CXModuleImpl module); + internal static extern CXModule clang_Module_getParent(QuantumBinding.Clang.Interop.CXModule module); /// /// Returns the specified top level header associated with the module. /// [DllImport(LibraryPath, EntryPoint = "clang_Module_getTopLevelHeader", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXFileImpl clang_Module_getTopLevelHeader(QuantumBinding.Clang.Interop.CXTranslationUnitImpl param0, QuantumBinding.Clang.Interop.CXModuleImpl module, uint index); + internal static extern CXFile clang_Module_getTopLevelHeader(QuantumBinding.Clang.Interop.CXTranslationUnitImpl param0, QuantumBinding.Clang.Interop.CXModule module, uint index); /// /// Returns non-zero if the module is a system one. /// [DllImport(LibraryPath, EntryPoint = "clang_Module_isSystem", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern int clang_Module_isSystem(QuantumBinding.Clang.Interop.CXModuleImpl module); + internal static extern int clang_Module_isSystem(QuantumBinding.Clang.Interop.CXModule module); /// /// Prune module files in the module cache directory that haven't been accessed in a long time. @@ -2080,37 +2080,37 @@ public static unsafe partial class ClangInterop /// Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit instead of an error code. In case of an error this routine returns a NULL CXTranslationUnit, without further detailed error codes. /// [DllImport(LibraryPath, EntryPoint = "clang_parseTranslationUnit", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXTranslationUnitImpl clang_parseTranslationUnit(QuantumBinding.Clang.Interop.CXIndexImpl cIdx, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, uint options); + internal static extern CXTranslationUnitImpl clang_parseTranslationUnit(QuantumBinding.Clang.Interop.CXIndex cIdx, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, uint options); /// /// Parse the given source file and the translation unit corresponding to that file. /// [DllImport(LibraryPath, EntryPoint = "clang_parseTranslationUnit2", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXErrorCode clang_parseTranslationUnit2(QuantumBinding.Clang.Interop.CXIndexImpl cIdx, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, uint options, out QuantumBinding.Clang.Interop.CXTranslationUnitImpl out_TU); + internal static extern CXErrorCode clang_parseTranslationUnit2(QuantumBinding.Clang.Interop.CXIndex cIdx, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, uint options, QuantumBinding.Clang.Interop.CXTranslationUnitImpl* out_TU); /// /// Same as clang_parseTranslationUnit2 but requires a full command line for command_line_args including argv[0]. This is useful if the standard library paths are relative to the binary. /// [DllImport(LibraryPath, EntryPoint = "clang_parseTranslationUnit2FullArgv", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern CXErrorCode clang_parseTranslationUnit2FullArgv(QuantumBinding.Clang.Interop.CXIndexImpl cIdx, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, uint options, out QuantumBinding.Clang.Interop.CXTranslationUnitImpl out_TU); + internal static extern CXErrorCode clang_parseTranslationUnit2FullArgv(QuantumBinding.Clang.Interop.CXIndex cIdx, sbyte* source_filename, sbyte** command_line_args, int num_command_line_args, QuantumBinding.Clang.Interop.CXUnsavedFile* unsaved_files, uint num_unsaved_files, uint options, QuantumBinding.Clang.Interop.CXTranslationUnitImpl* out_TU); /// /// Release a printing policy. /// [DllImport(LibraryPath, EntryPoint = "clang_PrintingPolicy_dispose", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_PrintingPolicy_dispose(QuantumBinding.Clang.Interop.CXPrintingPolicyImpl policy); + internal static extern void clang_PrintingPolicy_dispose(QuantumBinding.Clang.Interop.CXPrintingPolicy policy); /// /// Get a property value for the given printing policy. /// [DllImport(LibraryPath, EntryPoint = "clang_PrintingPolicy_getProperty", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_PrintingPolicy_getProperty(QuantumBinding.Clang.Interop.CXPrintingPolicyImpl policy, CXPrintingPolicyProperty property); + internal static extern uint clang_PrintingPolicy_getProperty(QuantumBinding.Clang.Interop.CXPrintingPolicy policy, CXPrintingPolicyProperty property); /// /// Set a property value for the given printing policy. /// [DllImport(LibraryPath, EntryPoint = "clang_PrintingPolicy_setProperty", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_PrintingPolicy_setProperty(QuantumBinding.Clang.Interop.CXPrintingPolicyImpl policy, CXPrintingPolicyProperty property, uint value); + internal static extern void clang_PrintingPolicy_setProperty(QuantumBinding.Clang.Interop.CXPrintingPolicy policy, CXPrintingPolicyProperty property, uint value); /// /// Returns non-zero if range is null. @@ -2119,13 +2119,13 @@ public static unsafe partial class ClangInterop internal static extern int clang_Range_isNull(QuantumBinding.Clang.Interop.CXSourceRange range); [DllImport(LibraryPath, EntryPoint = "clang_remap_dispose", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_remap_dispose(QuantumBinding.Clang.Interop.CXRemappingImpl param0); + internal static extern void clang_remap_dispose(QuantumBinding.Clang.Interop.CXRemapping param0); [DllImport(LibraryPath, EntryPoint = "clang_remap_getFilenames", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern void clang_remap_getFilenames(QuantumBinding.Clang.Interop.CXRemappingImpl param0, uint param1, QuantumBinding.Clang.Interop.CXString* param2, QuantumBinding.Clang.Interop.CXString* param3); + internal static extern void clang_remap_getFilenames(QuantumBinding.Clang.Interop.CXRemapping param0, uint param1, QuantumBinding.Clang.Interop.CXString* param2, QuantumBinding.Clang.Interop.CXString* param3); [DllImport(LibraryPath, EntryPoint = "clang_remap_getNumFiles", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_remap_getNumFiles(QuantumBinding.Clang.Interop.CXRemappingImpl param0); + internal static extern uint clang_remap_getNumFiles(QuantumBinding.Clang.Interop.CXRemapping param0); /// /// Reparse the source files that produced this translation unit. @@ -2323,7 +2323,7 @@ public static unsafe partial class ClangInterop /// Visit the fields of a particular type. /// [DllImport(LibraryPath, EntryPoint = "clang_Type_visitFields", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_Type_visitFields(QuantumBinding.Clang.Interop.CXType t, nuint visitor, QuantumBinding.Clang.Interop.CXClientDataImpl client_data); + internal static extern uint clang_Type_visitFields(QuantumBinding.Clang.Interop.CXType t, nuint visitor, QuantumBinding.Clang.Interop.CXClientData client_data); /// /// Returns text contained in the AST node. @@ -2371,7 +2371,7 @@ public static unsafe partial class ClangInterop /// Visit the children of a particular cursor. /// [DllImport(LibraryPath, EntryPoint = "clang_visitChildren", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_visitChildren(QuantumBinding.Clang.Interop.CXCursor parent, nuint visitor, QuantumBinding.Clang.Interop.CXClientDataImpl client_data); + internal static extern uint clang_visitChildren(QuantumBinding.Clang.Interop.CXCursor parent, nuint visitor, QuantumBinding.Clang.Interop.CXClientData client_data); /// /// Visits the children of a cursor using the specified block. Behaves identically to clang_visitChildren() in all other respects. @@ -2383,13 +2383,13 @@ public static unsafe partial class ClangInterop /// Visit the base classes of a type. /// [DllImport(LibraryPath, EntryPoint = "clang_visitCXXBaseClasses", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_visitCXXBaseClasses(QuantumBinding.Clang.Interop.CXType t, nuint visitor, QuantumBinding.Clang.Interop.CXClientDataImpl client_data); + internal static extern uint clang_visitCXXBaseClasses(QuantumBinding.Clang.Interop.CXType t, nuint visitor, QuantumBinding.Clang.Interop.CXClientData client_data); /// /// Visit the class methods of a type. /// [DllImport(LibraryPath, EntryPoint = "clang_visitCXXMethods", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - internal static extern uint clang_visitCXXMethods(QuantumBinding.Clang.Interop.CXType t, nuint visitor, QuantumBinding.Clang.Interop.CXClientDataImpl client_data); + internal static extern uint clang_visitCXXMethods(QuantumBinding.Clang.Interop.CXType t, nuint visitor, QuantumBinding.Clang.Interop.CXClientData client_data); } diff --git a/QuantumBinding.Clang/Generated/Interop/OldFashionDelegates/OldFashionDelegates.cs b/QuantumBinding.Clang/Generated/Interop/OldFashionDelegates/OldFashionDelegates.cs index ecd6ffa..858d1f5 100644 --- a/QuantumBinding.Clang/Generated/Interop/OldFashionDelegates/OldFashionDelegates.cs +++ b/QuantumBinding.Clang/Generated/Interop/OldFashionDelegates/OldFashionDelegates.cs @@ -18,17 +18,17 @@ public static unsafe class Delegates /// Visitor invoked for each cursor found by a traversal. /// [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate CXChildVisitResult CXCursorVisitor(QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXCursor parent, QuantumBinding.Clang.Interop.CXClientDataImpl client_data); + public unsafe delegate CXChildVisitResult CXCursorVisitor(QuantumBinding.Clang.Interop.CXCursor cursor, QuantumBinding.Clang.Interop.CXCursor parent, QuantumBinding.Clang.Interop.CXClientData client_data); /// /// Visitor invoked for each file in a translation unit (used with clang_getInclusions()). /// [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void CXInclusionVisitor(QuantumBinding.Clang.Interop.CXFileImpl included_file, QuantumBinding.Clang.Interop.CXSourceLocation* inclusion_stack, uint include_len, QuantumBinding.Clang.Interop.CXClientDataImpl client_data); + public unsafe delegate void CXInclusionVisitor(QuantumBinding.Clang.Interop.CXFile included_file, QuantumBinding.Clang.Interop.CXSourceLocation* inclusion_stack, uint include_len, QuantumBinding.Clang.Interop.CXClientData client_data); /// /// Visitor invoked for each field found by a traversal. /// [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate CXVisitorResult CXFieldVisitor(QuantumBinding.Clang.Interop.CXCursor C, QuantumBinding.Clang.Interop.CXClientDataImpl client_data); + public unsafe delegate CXVisitorResult CXFieldVisitor(QuantumBinding.Clang.Interop.CXCursor C, QuantumBinding.Clang.Interop.CXClientData client_data); } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXAPISetImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXAPISetImpl.cs index 34fb5da..3d7a266 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXAPISetImpl.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXAPISetImpl.cs @@ -14,7 +14,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXAPISetImpl { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXClientData.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXClientData.cs new file mode 100644 index 0000000..fbe8cf3 --- /dev/null +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXClientData.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// Opaque pointer representing client data that will be passed through to various callbacks and visitors. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXClientData +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXComment.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXComment.cs index c16c4e3..b6724c9 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXComment.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXComment.cs @@ -18,7 +18,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXComment { - public nuint aSTNode; + public void* aSTNode; public CXTranslationUnitImpl translationUnit; } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXCompletionResult.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXCompletionResult.cs index df5ff2e..9727769 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXCompletionResult.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXCompletionResult.cs @@ -25,7 +25,7 @@ public unsafe partial struct CXCompletionResult /// /// The code-completion string that describes how to insert this code-completion result into the editing buffer. /// - public CXCompletionStringImpl completionString; + public CXCompletionString completionString; } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXCompletionString.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXCompletionString.cs new file mode 100644 index 0000000..29d6e31 --- /dev/null +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXCompletionString.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// A semantic string that describes a code-completion result. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXCompletionString +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXCursorAndRangeVisitor.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXCursorAndRangeVisitor.cs index 5cbb4a1..ac93a8c 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXCursorAndRangeVisitor.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXCursorAndRangeVisitor.cs @@ -8,15 +8,14 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using QuantumBinding.Clang; namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXCursorAndRangeVisitor { - public nuint context; - public nuint visit; + public void* context; + public void* visit; } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXCursorSetImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXCursorSetImpl.cs index 7f90e72..065c72a 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXCursorSetImpl.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXCursorSetImpl.cs @@ -14,7 +14,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXCursorSetImpl { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXDiagnostic.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXDiagnostic.cs new file mode 100644 index 0000000..495befe --- /dev/null +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXDiagnostic.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// A single diagnostic, containing the diagnostic's severity, location, text, source ranges, and fix-it hints. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXDiagnostic +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXClientDataImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXDiagnosticSet.cs similarity index 81% rename from QuantumBinding.Clang/Generated/Interop/Structs/CXClientDataImpl.cs rename to QuantumBinding.Clang/Generated/Interop/Structs/CXDiagnosticSet.cs index 472979e..7fb65a5 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXClientDataImpl.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXDiagnosticSet.cs @@ -11,10 +11,13 @@ namespace QuantumBinding.Clang.Interop; +/// +/// A group of CXDiagnostics. +/// [StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXClientDataImpl +public unsafe partial struct CXDiagnosticSet { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXCompletionStringImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXEvalResult.cs similarity index 81% rename from QuantumBinding.Clang/Generated/Interop/Structs/CXCompletionStringImpl.cs rename to QuantumBinding.Clang/Generated/Interop/Structs/CXEvalResult.cs index 55ec3f8..396b6aa 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXCompletionStringImpl.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXEvalResult.cs @@ -11,10 +11,13 @@ namespace QuantumBinding.Clang.Interop; +/// +/// Evaluation result of a cursor +/// [StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXCompletionStringImpl +public unsafe partial struct CXEvalResult { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXEvalResultImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXEvalResultImpl.cs deleted file mode 100644 index 8f2c207..0000000 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXEvalResultImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXEvalResultImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXDiagnosticImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXFile.cs similarity index 78% rename from QuantumBinding.Clang/Generated/Interop/Structs/CXDiagnosticImpl.cs rename to QuantumBinding.Clang/Generated/Interop/Structs/CXFile.cs index 6422451..5e6bdf3 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXDiagnosticImpl.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXFile.cs @@ -11,10 +11,13 @@ namespace QuantumBinding.Clang.Interop; +/// +/// A particular source file that is part of a translation unit. +/// [StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXDiagnosticImpl +public unsafe partial struct CXFile { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXFileImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXFileImpl.cs deleted file mode 100644 index b5d78fe..0000000 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXFileImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXFileImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientASTFile.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientASTFile.cs new file mode 100644 index 0000000..4f78068 --- /dev/null +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientASTFile.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// The client's data object that is associated with an AST file (PCH or module). +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXIdxClientASTFile +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientASTFileImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientASTFileImpl.cs deleted file mode 100644 index 105c9c3..0000000 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientASTFileImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXIdxClientASTFileImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientContainer.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientContainer.cs new file mode 100644 index 0000000..7312199 --- /dev/null +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientContainer.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// The client's data object that is associated with a semantic container of entities. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXIdxClientContainer +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientContainerImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientContainerImpl.cs deleted file mode 100644 index a6a717e..0000000 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientContainerImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXIdxClientContainerImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientEntity.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientEntity.cs new file mode 100644 index 0000000..83ca69d --- /dev/null +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientEntity.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// The client's data object that is associated with a semantic entity. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXIdxClientEntity +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientEntityImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientEntityImpl.cs deleted file mode 100644 index 2a5ee8b..0000000 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientEntityImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXIdxClientEntityImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXDiagnosticSetImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientFile.cs similarity index 78% rename from QuantumBinding.Clang/Generated/Interop/Structs/CXDiagnosticSetImpl.cs rename to QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientFile.cs index ec89fb7..d9fcb1c 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXDiagnosticSetImpl.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientFile.cs @@ -11,10 +11,13 @@ namespace QuantumBinding.Clang.Interop; +/// +/// The client's data object that is associated with a CXFile. +/// [StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXDiagnosticSetImpl +public unsafe partial struct CXIdxClientFile { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientFileImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientFileImpl.cs deleted file mode 100644 index 01387e4..0000000 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxClientFileImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXIdxClientFileImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxImportedASTFileInfo.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxImportedASTFileInfo.cs index 6c0221b..789f6fd 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxImportedASTFileInfo.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxImportedASTFileInfo.cs @@ -8,7 +8,6 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using QuantumBinding.Clang; namespace QuantumBinding.Clang.Interop; @@ -21,11 +20,11 @@ public unsafe partial struct CXIdxImportedASTFileInfo /// /// Top level AST file containing the imported PCH, module or submodule. /// - public CXFileImpl file; + public CXFile file; /// /// The imported module or NULL if the AST file is a PCH. /// - public CXModuleImpl module; + public CXModule module; /// /// Location where the file is imported. Applicable only for modules. /// diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxIncludedFileInfo.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxIncludedFileInfo.cs index 6438dbe..315f3d5 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxIncludedFileInfo.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXIdxIncludedFileInfo.cs @@ -8,7 +8,6 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using QuantumBinding.Clang; namespace QuantumBinding.Clang.Interop; @@ -29,7 +28,7 @@ public unsafe partial struct CXIdxIncludedFileInfo /// /// The actual file that the #include/#import directive resolved to. /// - public CXFileImpl file; + public CXFile file; public int isImport; public int isAngled; /// diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXIndex.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXIndex.cs new file mode 100644 index 0000000..6a47649 --- /dev/null +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXIndex.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// An "index" that consists of a set of translation units that would typically be linked together into an executable or library. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXIndex +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXIndexAction.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXIndexAction.cs new file mode 100644 index 0000000..4f137cd --- /dev/null +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXIndexAction.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// An indexing action/session, to be applied to one or multiple translation units. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXIndexAction +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXIndexActionImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXIndexActionImpl.cs deleted file mode 100644 index 47f51ad..0000000 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXIndexActionImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXIndexActionImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXIndexImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXIndexImpl.cs deleted file mode 100644 index 2624b66..0000000 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXIndexImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXIndexImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXModule.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXModule.cs new file mode 100644 index 0000000..02774f1 --- /dev/null +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXModule.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// The functions in this group provide access to information about modules. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXModule +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXModuleImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXModuleImpl.cs deleted file mode 100644 index 7715bf4..0000000 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXModuleImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXModuleImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXModuleMapDescriptorImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXModuleMapDescriptorImpl.cs index 671db06..c116557 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXModuleMapDescriptorImpl.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXModuleMapDescriptorImpl.cs @@ -14,7 +14,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXModuleMapDescriptorImpl { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXPrintingPolicy.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXPrintingPolicy.cs new file mode 100644 index 0000000..aece309 --- /dev/null +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXPrintingPolicy.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// Opaque pointer representing a policy that controls pretty printing for clang_getCursorPrettyPrinted. +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXPrintingPolicy +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXPrintingPolicyImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXPrintingPolicyImpl.cs deleted file mode 100644 index 5db69c5..0000000 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXPrintingPolicyImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXPrintingPolicyImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXRemapping.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXRemapping.cs new file mode 100644 index 0000000..cd9051f --- /dev/null +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXRemapping.cs @@ -0,0 +1,24 @@ +// ---------------------------------------------------------------------------------------------- +// +// This file was autogenerated by QuantumBindingGenerator. +// Do not edit this file manually, because you will lose all your changes after next generation. +// +// ---------------------------------------------------------------------------------------------- + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuantumBinding.Clang.Interop; + +/// +/// CINDEX_DEPRECATED - disabled to silence MSVC deprecation warnings +/// +[StructLayout(LayoutKind.Sequential)] +public unsafe partial struct CXRemapping +{ + public void* pointer; +} + + + diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXRemappingImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXRemappingImpl.cs deleted file mode 100644 index a35ccc7..0000000 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXRemappingImpl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ---------------------------------------------------------------------------------------------- -// -// This file was autogenerated by QuantumBindingGenerator. -// Do not edit this file manually, because you will lose all your changes after next generation. -// -// ---------------------------------------------------------------------------------------------- - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuantumBinding.Clang.Interop; - -[StructLayout(LayoutKind.Sequential)] -public unsafe partial struct CXRemappingImpl -{ - public nuint pointer; -} - - - diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXString.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXString.cs index ab6fe99..85eb145 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXString.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXString.cs @@ -17,7 +17,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXString { - public nuint data; + public void* data; public uint private_flags; } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXTUResourceUsage.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXTUResourceUsage.cs index 4c279bc..e0ccc5a 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXTUResourceUsage.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXTUResourceUsage.cs @@ -20,7 +20,7 @@ public unsafe partial struct CXTUResourceUsage /// /// Private data member, used for queries. /// - public nuint data; + public void* data; /// /// The number of entries in the 'entries' array. /// diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXTargetInfoImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXTargetInfoImpl.cs index 9f8d33d..62df09b 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXTargetInfoImpl.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXTargetInfoImpl.cs @@ -14,7 +14,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXTargetInfoImpl { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXToken.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXToken.cs index c0487be..e10e346 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXToken.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXToken.cs @@ -18,7 +18,7 @@ namespace QuantumBinding.Clang.Interop; public unsafe partial struct CXToken { public unsafe fixed uint int_data[4]; - public nuint ptr_data; + public void* ptr_data; } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXTranslationUnitImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXTranslationUnitImpl.cs index 1ab6d0f..985890f 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXTranslationUnitImpl.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXTranslationUnitImpl.cs @@ -14,7 +14,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXTranslationUnitImpl { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/CXVirtualFileOverlayImpl.cs b/QuantumBinding.Clang/Generated/Interop/Structs/CXVirtualFileOverlayImpl.cs index 006b0d0..a1a7cb0 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/CXVirtualFileOverlayImpl.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/CXVirtualFileOverlayImpl.cs @@ -14,7 +14,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct CXVirtualFileOverlayImpl { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/IndexerCallbacks.cs b/QuantumBinding.Clang/Generated/Interop/Structs/IndexerCallbacks.cs index c191330..33277f3 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/IndexerCallbacks.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/IndexerCallbacks.cs @@ -8,7 +8,6 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using QuantumBinding.Clang; namespace QuantumBinding.Clang.Interop; @@ -21,29 +20,29 @@ public unsafe partial struct IndexerCallbacks /// /// Called periodically to check whether indexing should be aborted. Should return 0 to continue, and non-zero to abort. /// - public nuint abortQuery; + public delegate* unmanaged abortQuery; /// /// Called at the end of indexing; passes the complete diagnostic set. /// - public nuint diagnostic; - public nuint enteredMainFile; + public delegate* unmanaged diagnostic; + public delegate* unmanaged enteredMainFile; /// /// Called when a file gets #included/#imported. /// - public nuint ppIncludedFile; + public delegate* unmanaged ppIncludedFile; /// /// Called when a AST file (PCH or module) gets imported. /// - public nuint importedASTFile; + public delegate* unmanaged importedASTFile; /// /// Called at the beginning of indexing a translation unit. /// - public nuint startedTranslationUnit; - public nuint indexDeclaration; + public delegate* unmanaged startedTranslationUnit; + public delegate* unmanaged indexDeclaration; /// /// Called to index a reference of an entity. /// - public nuint indexEntityReference; + public delegate* unmanaged indexEntityReference; } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/_CXChildVisitResult.cs b/QuantumBinding.Clang/Generated/Interop/Structs/_CXChildVisitResult.cs index 108c93f..4a2eb26 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/_CXChildVisitResult.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/_CXChildVisitResult.cs @@ -14,7 +14,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct _CXChildVisitResult { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.Clang/Generated/Interop/Structs/_CXCursorAndRangeVisitorBlock.cs b/QuantumBinding.Clang/Generated/Interop/Structs/_CXCursorAndRangeVisitorBlock.cs index 7f66b6b..c0028c4 100644 --- a/QuantumBinding.Clang/Generated/Interop/Structs/_CXCursorAndRangeVisitorBlock.cs +++ b/QuantumBinding.Clang/Generated/Interop/Structs/_CXCursorAndRangeVisitorBlock.cs @@ -14,7 +14,7 @@ namespace QuantumBinding.Clang.Interop; [StructLayout(LayoutKind.Sequential)] public unsafe partial struct _CXCursorAndRangeVisitorBlock { - public nuint pointer; + public void* pointer; } diff --git a/QuantumBinding.Clang/Generated/StaticMethods/QuantumBinding.Clang.StaticMethods.cs b/QuantumBinding.Clang/Generated/StaticMethods/QuantumBinding.Clang.StaticMethods.cs index a75fc87..3769f37 100644 --- a/QuantumBinding.Clang/Generated/StaticMethods/QuantumBinding.Clang.StaticMethods.cs +++ b/QuantumBinding.Clang/Generated/StaticMethods/QuantumBinding.Clang.StaticMethods.cs @@ -36,7 +36,9 @@ public static QBVirtualFileOverlay VirtualFileOverlay_create(uint options) /// public static void Free(ref nuint buffer) { - QuantumBinding.Clang.Interop.ClangInterop.clang_free(buffer); + var arg0 = (void*)buffer; + QuantumBinding.Clang.Interop.ClangInterop.clang_free(arg0); + buffer = (nuint)arg0; } /// @@ -112,8 +114,15 @@ int CalculateSize(string file) { ref System.Span currentCursor = ref mainBuffer; var arg0 = QuantumBinding.Utils.MarshalContextUtils.MarshalString(file, ref currentCursor); - QuantumBinding.Clang.Interop.CXString arg2; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_loadDiagnostics(arg0, out error, out arg2); + var arg1 = stackalloc QuantumBinding.Clang.CXLoadDiag_Error[1]; + QuantumBinding.Clang.Interop.CXString arg2 = default; + var result = QuantumBinding.Clang.Interop.ClangInterop.clang_loadDiagnostics(arg0, arg1, &arg2); + if (arg1 is not null) + { + error = *arg1; + } + else + error = default; errorString = new QBString(arg2); return result; } @@ -491,7 +500,10 @@ public static void EnableStackTraces() public static void ExecuteOnThread(nuint fn, ref nuint user_data, uint stack_size) { - QuantumBinding.Clang.Interop.ClangInterop.clang_executeOnThread(fn, user_data, stack_size); + var arg0 = (void*)fn; + var arg1 = (void*)user_data; + QuantumBinding.Clang.Interop.ClangInterop.clang_executeOnThread(arg0, arg1, stack_size); + user_data = (nuint)arg1; } /// @@ -1041,7 +1053,7 @@ int CalculateSize(QBIdxContainerInfo param0) { ref System.Span currentCursor = ref mainBuffer; var arg0 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(param0, ref currentCursor); - var arg1 = param1 == null ? new CXIdxClientContainerImpl() : (CXIdxClientContainerImpl)param1; + var arg1 = param1 == null ? new CXIdxClientContainer() : (CXIdxClientContainer)param1; QuantumBinding.Clang.Interop.ClangInterop.clang_index_setClientContainer(arg0, arg1); } finally @@ -1100,7 +1112,7 @@ int CalculateSize(QBIdxEntityInfo param0) { ref System.Span currentCursor = ref mainBuffer; var arg0 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(param0, ref currentCursor); - var arg1 = param1 == null ? new CXIdxClientEntityImpl() : (CXIdxClientEntityImpl)param1; + var arg1 = param1 == null ? new CXIdxClientEntity() : (CXIdxClientEntity)param1; QuantumBinding.Clang.Interop.ClangInterop.clang_index_setClientEntity(arg0, arg1); } finally diff --git a/QuantumBinding.Clang/Generated/StructWrappers/IndexerCallbacks.cs b/QuantumBinding.Clang/Generated/StructWrappers/IndexerCallbacks.cs index 8e1e2a4..f0441f6 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/IndexerCallbacks.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/IndexerCallbacks.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// A group of callbacks used by #clang_indexSourceFile and #clang_indexTranslationUnit. +/// public unsafe partial class IndexerCallbacks : IMarshallableObject, IMarshallable { public IndexerCallbacks() @@ -23,14 +26,14 @@ public IndexerCallbacks(in QuantumBinding.Clang.Interop.IndexerCallbacks native) MarshalFrom(in native); } - public nuint AbortQuery { get; set; } - public nuint Diagnostic { get; set; } - public nuint EnteredMainFile { get; set; } - public nuint PIncludedFile { get; set; } - public nuint ImportedASTFile { get; set; } - public nuint StartedTranslationUnit { get; set; } - public nuint IndexDeclaration { get; set; } - public nuint IndexEntityReference { get; set; } + public delegate* unmanaged AbortQuery { get; set; } + public delegate* unmanaged Diagnostic { get; set; } + public delegate* unmanaged EnteredMainFile { get; set; } + public delegate* unmanaged PIncludedFile { get; set; } + public delegate* unmanaged ImportedASTFile { get; set; } + public delegate* unmanaged StartedTranslationUnit { get; set; } + public delegate* unmanaged IndexDeclaration { get; set; } + public delegate* unmanaged IndexEntityReference { get; set; } public static implicit operator IndexerCallbacks(QuantumBinding.Clang.Interop.IndexerCallbacks i) { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBCodeCompleteResults.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBCodeCompleteResults.cs index 785714f..a78b9d7 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBCodeCompleteResults.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBCodeCompleteResults.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Contains the results of code-completion. +/// public unsafe partial class QBCodeCompleteResults : IMarshallableObject, IMarshallable { public QBCodeCompleteResults() diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBComment.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBComment.cs index cf737a0..d3a3c4e 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBComment.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBComment.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// A parsed comment. +/// public unsafe partial class QBComment : IMarshallableObject, IMarshallable { public QBComment() @@ -374,7 +377,7 @@ public void MarshalTo(ref MarshallingContext context) { - context.Destination[0].aSTNode = qBComment.ASTNode; + if (qBComment.ASTNode != default) + { + context.Destination[0].aSTNode = (void*)qBComment.ASTNode; + } if (qBComment.TranslationUnit != default) { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBCompletionResult.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBCompletionResult.cs index 092a6e7..d883c59 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBCompletionResult.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBCompletionResult.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// A single result of code completion. +/// public unsafe partial class QBCompletionResult : IMarshallableObject, IMarshallable { public QBCompletionResult() @@ -63,10 +66,7 @@ public CXCompletionResultMarshaller(QuantumBinding.Clang.QBCompletionResult qBCo { context.Destination[0].cursorKind = qBCompletionResult.CursorKind; - if (qBCompletionResult.CompletionString != default) - { - context.Destination[0].completionString = qBCompletionResult.CompletionString; - } + context.Destination[0].completionString = qBCompletionResult.CompletionString; } } diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBCursor.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBCursor.cs index bb4408b..0e3a3de 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBCursor.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBCursor.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// A cursor representing some element in the abstract syntax tree for a translation unit. +/// public unsafe partial class QBCursor : IMarshallableObject, IMarshallable { public QBCursor() @@ -528,11 +531,7 @@ int CalculateSize(QBCursor c, QBString language, QBString definedIn) var arg0 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToNative(this, ref currentCursor); var arg1 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(language, ref currentCursor); var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(definedIn, ref currentCursor); - var arg3 = stackalloc uint[1]; - *arg3 = isGenerated; - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_Cursor_isExternalSymbol(arg0, arg1, arg2, arg3); - isGenerated = *arg3; - return result; + return QuantumBinding.Clang.Interop.ClangInterop.clang_Cursor_isExternalSymbol(arg0, arg1, arg2, ref isGenerated); } finally { @@ -855,7 +854,7 @@ int CalculateSize(QBCursor cursor, QBCursorAndRangeVisitor visitor) { ref System.Span currentCursor = ref mainBuffer; var arg0 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToNative(this, ref currentCursor); - var arg1 = file == null ? new CXFileImpl() : (CXFileImpl)file; + var arg1 = file == null ? new CXFile() : (CXFile)file; var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToNative(visitor, ref currentCursor); return QuantumBinding.Clang.Interop.ClangInterop.clang_findReferencesInFile(arg0, arg1, arg2); } @@ -870,7 +869,7 @@ public CXResult FindReferencesInFileWithBlock(QuantumBinding.Clang.QBFile param1 { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - var arg1 = param1 == null ? new CXFileImpl() : (CXFileImpl)param1; + var arg1 = param1 == null ? new CXFile() : (CXFile)param1; var arg2 = param2 == null ? new _CXCursorAndRangeVisitorBlock() : (_CXCursorAndRangeVisitorBlock)param2; return QuantumBinding.Clang.Interop.ClangInterop.clang_findReferencesInFileWithBlock(native, arg1, arg2); } @@ -1039,17 +1038,13 @@ int CalculateSize(QBCursor cursor, QBString deprecated_message, QBString unavail var arg1 = stackalloc int[1]; *arg1 = always_deprecated; var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(deprecated_message, ref currentCursor); - var arg3 = stackalloc int[1]; - *arg3 = always_unavailable; var arg4 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToPointer(unavailable_message, ref currentCursor); QuantumBinding.Clang.Interop.CXPlatformAvailability* arg5 = null; if (!availability.IsEmpty) { arg5 = QuantumBinding.Utils.MarshalContextUtils.MarshalArrayOfWrappers(availability, ref currentCursor); } - var result = QuantumBinding.Clang.Interop.ClangInterop.clang_getCursorPlatformAvailability(arg0, arg1, arg2, arg3, arg4, arg5, availability_size); - always_unavailable = *arg3; - return result; + return QuantumBinding.Clang.Interop.ClangInterop.clang_getCursorPlatformAvailability(arg0, arg1, arg2, ref always_unavailable, arg4, arg5, availability_size); } finally { @@ -1065,7 +1060,7 @@ public QBString GetCursorPrettyPrinted(QuantumBinding.Clang.QBPrintingPolicy pol { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - var arg1 = policy == null ? new CXPrintingPolicyImpl() : (CXPrintingPolicyImpl)policy; + var arg1 = policy == null ? new CXPrintingPolicy() : (CXPrintingPolicy)policy; return QuantumBinding.Clang.Interop.ClangInterop.clang_getCursorPrettyPrinted(native, arg1); } @@ -1220,19 +1215,7 @@ int CalculateSize(QBCursor param0, System.ReadOnlySpan startBuf, System. var arg0 = QuantumBinding.Utils.MarshalContextUtils.MarshalStructToNative(this, ref currentCursor); var arg1 = QuantumBinding.Utils.MarshalContextUtils.MarshalStringArray(startBuf, ref currentCursor); var arg2 = QuantumBinding.Utils.MarshalContextUtils.MarshalStringArray(endBuf, ref currentCursor); - var arg3 = stackalloc uint[1]; - *arg3 = startLine; - var arg4 = stackalloc uint[1]; - *arg4 = startColumn; - var arg5 = stackalloc uint[1]; - *arg5 = endLine; - var arg6 = stackalloc uint[1]; - *arg6 = endColumn; - QuantumBinding.Clang.Interop.ClangInterop.clang_getDefinitionSpellingAndExtent(arg0, arg1, arg2, arg3, arg4, arg5, arg6); - startLine = *arg3; - startColumn = *arg4; - endLine = *arg5; - endColumn = *arg6; + QuantumBinding.Clang.Interop.ClangInterop.clang_getDefinitionSpellingAndExtent(arg0, arg1, arg2, ref startLine, ref startColumn, ref endLine, ref endColumn); } finally { @@ -1360,7 +1343,7 @@ public void GetOverriddenCursors(out QBCursor[] overridden, out uint num_overrid { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - QuantumBinding.Clang.Interop.CXCursor* arg1 = null; + QuantumBinding.Clang.Interop.CXCursor* arg1 = default; QuantumBinding.Clang.Interop.ClangInterop.clang_getOverriddenCursors(native, arg1, out num_overridden); overridden = new QuantumBinding.Clang.QBCursor[num_overridden]; for (var i = 0U; i < num_overridden; ++i) @@ -1456,7 +1439,7 @@ public uint VisitChildren(nuint visitor, QuantumBinding.Clang.QBClientData clien { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - var arg2 = client_data == null ? new CXClientDataImpl() : (CXClientDataImpl)client_data; + var arg2 = client_data == null ? new CXClientData() : (CXClientData)client_data; return QuantumBinding.Clang.Interop.ClangInterop.clang_visitChildren(native, visitor, arg2); } diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBCursorAndRangeVisitor.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBCursorAndRangeVisitor.cs index 6e80799..4d285e5 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBCursorAndRangeVisitor.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBCursorAndRangeVisitor.cs @@ -44,8 +44,8 @@ public void MarshalTo(ref MarshallingContext(ref TContext context) where TContext : IMarshallingContext, allows ref struct @@ -61,9 +61,15 @@ private ref struct CXCursorAndRangeVisitorMarshaller { public CXCursorAndRangeVisitorMarshaller(QuantumBinding.Clang.QBCursorAndRangeVisitor qBCursorAndRangeVisitor, ref QuantumBinding.Utils.MarshallingContext context) { - context.Destination[0].context = qBCursorAndRangeVisitor.Context; + if (qBCursorAndRangeVisitor.Context != default) + { + context.Destination[0].context = (void*)qBCursorAndRangeVisitor.Context; + } - context.Destination[0].visit = qBCursorAndRangeVisitor.Visit; + if (qBCursorAndRangeVisitor.Visit != default) + { + context.Destination[0].visit = (void*)qBCursorAndRangeVisitor.Visit; + } } } diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBFileUniqueID.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBFileUniqueID.cs index 8f3d32c..19a23aa 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBFileUniqueID.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBFileUniqueID.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Uniquely identifies a CXFile, that refers to the same underlying file, across an indexing session. +/// public unsafe partial class QBFileUniqueID : IMarshallableObject, IMarshallable { public QBFileUniqueID() @@ -44,7 +47,8 @@ public void MarshalTo(ref MarshallingContext +/// Data for IndexerCallbacks#indexEntityReference. +/// public unsafe partial class QBIdxEntityRefInfo : IMarshallableObject, IMarshallable { public QBIdxEntityRefInfo() diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxImportedASTFileInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxImportedASTFileInfo.cs index 7cb430c..59e4f91 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxImportedASTFileInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxImportedASTFileInfo.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Data for IndexerCallbacks#importedASTFile. +/// public unsafe partial class QBIdxImportedASTFileInfo : IMarshallableObject, IMarshallable { public QBIdxImportedASTFileInfo() @@ -65,15 +68,9 @@ private ref struct CXIdxImportedASTFileInfoMarshaller { public CXIdxImportedASTFileInfoMarshaller(QuantumBinding.Clang.QBIdxImportedASTFileInfo qBIdxImportedASTFileInfo, ref QuantumBinding.Utils.MarshallingContext context) { - if (qBIdxImportedASTFileInfo.File != default) - { - context.Destination[0].file = qBIdxImportedASTFileInfo.File; - } + context.Destination[0].file = qBIdxImportedASTFileInfo.File; - if (qBIdxImportedASTFileInfo.Module != default) - { - context.Destination[0].module = qBIdxImportedASTFileInfo.Module; - } + context.Destination[0].module = qBIdxImportedASTFileInfo.Module; if (qBIdxImportedASTFileInfo.Loc != default) { diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxIncludedFileInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxIncludedFileInfo.cs index 089f4a9..9a703ab 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxIncludedFileInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxIncludedFileInfo.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Data for ppIncludedFile callback. +/// public unsafe partial class QBIdxIncludedFileInfo : IMarshallableObject, IMarshallable { public QBIdxIncludedFileInfo() @@ -90,10 +93,7 @@ public CXIdxIncludedFileInfoMarshaller(QuantumBinding.Clang.QBIdxIncludedFileInf context.Destination[0].filename = (sbyte*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref System.Runtime.InteropServices.MemoryMarshal.GetReference(stringSpan)); } - if (qBIdxIncludedFileInfo.File != default) - { - context.Destination[0].file = qBIdxIncludedFileInfo.File; - } + context.Destination[0].file = qBIdxIncludedFileInfo.File; context.Destination[0].isImport = qBIdxIncludedFileInfo.IsImport; diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxLoc.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxLoc.cs index 3780d9c..58f3f29 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxLoc.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxLoc.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Source location passed to index callbacks. +/// public unsafe partial class QBIdxLoc : IMarshallableObject, IMarshallable { public QBIdxLoc() @@ -42,9 +45,9 @@ public void IndexLoc_getFileLocation(out QuantumBinding.Clang.QBIdxClientFile in { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - CXIdxClientFileImpl arg1; - CXFileImpl arg2; - QuantumBinding.Clang.Interop.ClangInterop.clang_indexLoc_getFileLocation(native, out arg1, out arg2, out line, out column, out offset); + CXIdxClientFile arg1 = default; + CXFile arg2 = default; + QuantumBinding.Clang.Interop.ClangInterop.clang_indexLoc_getFileLocation(native, &arg1, &arg2, out line, out column, out offset); indexFile = new QBIdxClientFile(arg1); file = new QBFile(arg2); } diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCProtocolRefListInfo.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCProtocolRefListInfo.cs index 472a3b7..343eec2 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCProtocolRefListInfo.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBIdxObjCProtocolRefListInfo.cs @@ -54,9 +54,10 @@ public void MarshalTo(ref MarshallingContext +/// Index initialization options. +/// public unsafe partial class QBIndexOptions : IMarshallableObject, IMarshallable { public QBIndexOptions() diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBPlatformAvailability.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBPlatformAvailability.cs index 54663b2..f5e1a2c 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBPlatformAvailability.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBPlatformAvailability.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Describes the availability of a given entity on a particular platform, e.g., a particular class might only be available on Mac OS 10.7 or newer. +/// public unsafe partial class QBPlatformAvailability : IMarshallableObject, IMarshallable { public QBPlatformAvailability() diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBSourceLocation.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBSourceLocation.cs index 8e7117c..3c88263 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBSourceLocation.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBSourceLocation.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Identifies a specific source location within a translation unit. +/// public unsafe partial class QBSourceLocation : IMarshallableObject, IMarshallable { public QBSourceLocation() @@ -64,8 +67,8 @@ public void GetExpansionLocation(out QuantumBinding.Clang.QBFile file, out uint { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - CXFileImpl arg1; - QuantumBinding.Clang.Interop.ClangInterop.clang_getExpansionLocation(native, out arg1, out line, out column, out offset); + CXFile arg1 = default; + QuantumBinding.Clang.Interop.ClangInterop.clang_getExpansionLocation(native, &arg1, out line, out column, out offset); file = new QBFile(arg1); } @@ -76,8 +79,8 @@ public void GetFileLocation(out QuantumBinding.Clang.QBFile file, out uint line, { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - CXFileImpl arg1; - QuantumBinding.Clang.Interop.ClangInterop.clang_getFileLocation(native, out arg1, out line, out column, out offset); + CXFile arg1 = default; + QuantumBinding.Clang.Interop.ClangInterop.clang_getFileLocation(native, &arg1, out line, out column, out offset); file = new QBFile(arg1); } @@ -88,8 +91,8 @@ public void GetInstantiationLocation(out QuantumBinding.Clang.QBFile file, out u { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - CXFileImpl arg1; - QuantumBinding.Clang.Interop.ClangInterop.clang_getInstantiationLocation(native, out arg1, out line, out column, out offset); + CXFile arg1 = default; + QuantumBinding.Clang.Interop.ClangInterop.clang_getInstantiationLocation(native, &arg1, out line, out column, out offset); file = new QBFile(arg1); } @@ -100,8 +103,8 @@ public void GetPresumedLocation(out QBString filename, out uint line, out uint c { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - QuantumBinding.Clang.Interop.CXString arg1; - QuantumBinding.Clang.Interop.ClangInterop.clang_getPresumedLocation(native, out arg1, out line, out column); + QuantumBinding.Clang.Interop.CXString arg1 = default; + QuantumBinding.Clang.Interop.ClangInterop.clang_getPresumedLocation(native, &arg1, out line, out column); filename = new QBString(arg1); } @@ -144,8 +147,8 @@ public void GetSpellingLocation(out QuantumBinding.Clang.QBFile file, out uint l { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - CXFileImpl arg1; - QuantumBinding.Clang.Interop.ClangInterop.clang_getSpellingLocation(native, out arg1, out line, out column, out offset); + CXFile arg1 = default; + QuantumBinding.Clang.Interop.ClangInterop.clang_getSpellingLocation(native, &arg1, out line, out column, out offset); file = new QBFile(arg1); } diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBSourceRange.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBSourceRange.cs index 9001e84..f428921 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBSourceRange.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBSourceRange.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Identifies a half-open character range in the source code. +/// public unsafe partial class QBSourceRange : IMarshallableObject, IMarshallable { public QBSourceRange() diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBSourceRangeList.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBSourceRangeList.cs index b7a9d45..f068cbf 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBSourceRangeList.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBSourceRangeList.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Identifies an array of ranges. +/// public unsafe partial class QBSourceRangeList : IMarshallableObject, IMarshallable { public QBSourceRangeList() diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBString.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBString.cs index 7c54aa9..6b28a49 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBString.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBString.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// A character string. +/// public unsafe partial class QBString : IMarshallableObject, IMarshallable { public QBString() @@ -65,7 +68,7 @@ public void MarshalTo(ref MarshallingContext context) { - context.Destination[0].data = qBString.Data; + if (qBString.Data != default) + { + context.Destination[0].data = (void*)qBString.Data; + } context.Destination[0].private_flags = qBString.Private_flags; diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBTUResourceUsage.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBTUResourceUsage.cs index d6f06d5..711d0a7 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBTUResourceUsage.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBTUResourceUsage.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// The memory usage of a CXTranslationUnit, broken into categories. +/// public unsafe partial class QBTUResourceUsage : IMarshallableObject, IMarshallable { public QBTUResourceUsage() @@ -56,7 +59,7 @@ public void MarshalTo(ref MarshallingContext context) { - context.Destination[0].data = qBTUResourceUsage.Data; + if (qBTUResourceUsage.Data != default) + { + context.Destination[0].data = (void*)qBTUResourceUsage.Data; + } context.Destination[0].numEntries = qBTUResourceUsage.NumEntries; diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBToken.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBToken.cs index 739e40b..8604427 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBToken.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBToken.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Describes a single preprocessing token. +/// public unsafe partial class QBToken : IMarshallableObject, IMarshallable { public QBToken() @@ -55,10 +58,11 @@ public void MarshalTo(ref MarshallingContext(ref TContext context) where TContext : IMarshallingContext, allows ref struct @@ -80,7 +84,10 @@ public CXTokenMarshaller(QuantumBinding.Clang.QBToken qBToken, ref QuantumBindin QuantumBinding.Utils.MarshalingUtils.MarshalFixedArrayToPointer(qBToken.Int_data.Span, pDest, 4); } - context.Destination[0].ptr_data = qBToken.Ptr_data; + if (qBToken.Ptr_data != default) + { + context.Destination[0].ptr_data = (void*)qBToken.Ptr_data; + } } } diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBType.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBType.cs index 13112c0..dfe1c1b 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBType.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBType.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// The type of an element in the abstract syntax tree. +/// public unsafe partial class QBType : IMarshallableObject, IMarshallable { public QBType() @@ -134,7 +137,7 @@ public QBString GetFullyQualifiedName(QuantumBinding.Clang.QBPrintingPolicy poli { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - var arg1 = policy == null ? new CXPrintingPolicyImpl() : (CXPrintingPolicyImpl)policy; + var arg1 = policy == null ? new CXPrintingPolicy() : (CXPrintingPolicy)policy; return QuantumBinding.Clang.Interop.ClangInterop.clang_getFullyQualifiedName(native, arg1, withGlobalNsPrefix); } @@ -225,7 +228,7 @@ public QBString GetTypePrettyPrinted(QuantumBinding.Clang.QBPrintingPolicy cxPol { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - var arg1 = cxPolicy == null ? new CXPrintingPolicyImpl() : (CXPrintingPolicyImpl)cxPolicy; + var arg1 = cxPolicy == null ? new CXPrintingPolicy() : (CXPrintingPolicy)cxPolicy; return QuantumBinding.Clang.Interop.ClangInterop.clang_getTypePrettyPrinted(native, arg1); } @@ -508,7 +511,7 @@ public uint Type_visitFields(nuint visitor, QuantumBinding.Clang.QBClientData cl { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - var arg2 = client_data == null ? new CXClientDataImpl() : (CXClientDataImpl)client_data; + var arg2 = client_data == null ? new CXClientData() : (CXClientData)client_data; return QuantumBinding.Clang.Interop.ClangInterop.clang_Type_visitFields(native, visitor, arg2); } @@ -519,7 +522,7 @@ public uint VisitCXXBaseClasses(nuint visitor, QuantumBinding.Clang.QBClientData { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - var arg2 = client_data == null ? new CXClientDataImpl() : (CXClientDataImpl)client_data; + var arg2 = client_data == null ? new CXClientData() : (CXClientData)client_data; return QuantumBinding.Clang.Interop.ClangInterop.clang_visitCXXBaseClasses(native, visitor, arg2); } @@ -530,7 +533,7 @@ public uint VisitCXXMethods(nuint visitor, QuantumBinding.Clang.QBClientData cli { using var ctx = new NativeContext(GetSize(), stackalloc byte[(int)QuantumBinding.Utils.MarshalingUtils.StackAllocThreshold]); var native = this.MarshalToNative(ctx); - var arg2 = client_data == null ? new CXClientDataImpl() : (CXClientDataImpl)client_data; + var arg2 = client_data == null ? new CXClientData() : (CXClientData)client_data; return QuantumBinding.Clang.Interop.ClangInterop.clang_visitCXXMethods(native, visitor, arg2); } diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBUnsavedFile.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBUnsavedFile.cs index dd0806f..f2104f9 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBUnsavedFile.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBUnsavedFile.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Provides the contents of a file that has not yet been saved to disk. +/// public unsafe partial class QBUnsavedFile : IMarshallableObject, IMarshallable { public QBUnsavedFile() diff --git a/QuantumBinding.Clang/Generated/StructWrappers/QBVersion.cs b/QuantumBinding.Clang/Generated/StructWrappers/QBVersion.cs index c19ce3d..257b5a5 100644 --- a/QuantumBinding.Clang/Generated/StructWrappers/QBVersion.cs +++ b/QuantumBinding.Clang/Generated/StructWrappers/QBVersion.cs @@ -12,6 +12,9 @@ namespace QuantumBinding.Clang; +/// +/// Describes a version number of the form major.minor.subminor. +/// public unsafe partial class QBVersion : IMarshallableObject, IMarshallable { public QBVersion() diff --git a/QuantumBinding.Generator/Parser/Clang/ClangParser.cs b/QuantumBinding.Generator/Parser/Clang/ClangParser.cs index 543c87c..03bad89 100644 --- a/QuantumBinding.Generator/Parser/Clang/ClangParser.cs +++ b/QuantumBinding.Generator/Parser/Clang/ClangParser.cs @@ -109,7 +109,7 @@ private List GetArguments() return arguments; } - public CXChildVisitResult VisitDelegate(CXCursor cursor, CXCursor parent, CXClientDataImpl data) + public CXChildVisitResult VisitDelegate(CXCursor cursor, CXCursor parent, CXClientData data) { return Visit(cursor, parent, data); } @@ -187,7 +187,7 @@ private CXChildVisitResult VisitEnum(QBCursor cursor, QBCursor parent, QBClientD cursor.VisitChildren((nuint)Marshal.GetFunctionPointerForDelegate(_functionPtr).ToPointer(), new QBClientData()); //cursor.VisitChildren(Marshal.GetFunctionPointerForDelegate(_functionPtr).ToPointer(), new QBClientData()); - CXChildVisitResult VisitEnumItemsDelegate(CXCursor cursor, CXCursor parent, CXClientDataImpl data) + CXChildVisitResult VisitEnumItemsDelegate(CXCursor cursor, CXCursor parent, CXClientData data) { return VisitEnumItems(cursor, parent, data); } @@ -300,7 +300,7 @@ private CXChildVisitResult VisitStruct(QBCursor cursor, QBCursor parent, QBClien cursor.VisitChildren((nuint)Marshal.GetFunctionPointerForDelegate(_functionPtr).ToPointer(), new QBClientData()); - CXChildVisitResult VisitStructFieldsNative(CXCursor cursor, CXCursor parent, CXClientDataImpl data) + CXChildVisitResult VisitStructFieldsNative(CXCursor cursor, CXCursor parent, CXClientData data) { return VisitStructFields(cursor, parent, data); } @@ -529,7 +529,7 @@ private CXChildVisitResult VisitTypedef(QBCursor cursor, QBCursor parent, QBClie cursor.VisitChildren((nuint)Marshal.GetFunctionPointerForDelegate(_functionPtr).ToPointer(), new QBClientData()); - CXChildVisitResult VisitFunctionProtoNative(CXCursor cxCursor, CXCursor parent, CXClientDataImpl clientData) + CXChildVisitResult VisitFunctionProtoNative(CXCursor cxCursor, CXCursor parent, CXClientData clientData) { return VisitFunctionProto(cxCursor, parent, clientData); } diff --git a/QuantumBinding.Generator/Parser/Clang/ForwardDeclarationVisitor.cs b/QuantumBinding.Generator/Parser/Clang/ForwardDeclarationVisitor.cs index 0801f11..1962dc2 100644 --- a/QuantumBinding.Generator/Parser/Clang/ForwardDeclarationVisitor.cs +++ b/QuantumBinding.Generator/Parser/Clang/ForwardDeclarationVisitor.cs @@ -24,7 +24,7 @@ public ForwardDeclarationVisitor(QBCursor beginningCursor) public IntPtr VisitorPtr { get; } - public CXChildVisitResult VisitDelegate(CXCursor cursor, CXCursor parent, CXClientDataImpl data) + public CXChildVisitResult VisitDelegate(CXCursor cursor, CXCursor parent, CXClientData data) { return Visit(cursor, parent, data); } diff --git a/QuantumBinding.Generator/Parser/Clang/ICXCursorVisitor.cs b/QuantumBinding.Generator/Parser/Clang/ICXCursorVisitor.cs index 7b750be..d94d24c 100644 --- a/QuantumBinding.Generator/Parser/Clang/ICXCursorVisitor.cs +++ b/QuantumBinding.Generator/Parser/Clang/ICXCursorVisitor.cs @@ -5,5 +5,5 @@ namespace QuantumBinding.Generator.Parser.Clang; internal interface ICXCursorVisitor { - CXChildVisitResult VisitDelegate(CXCursor cursor, CXCursor parent, CXClientDataImpl client_data); + CXChildVisitResult VisitDelegate(CXCursor cursor, CXCursor parent, CXClientData client_data); } \ No newline at end of file