コード例 #1
0
 public static extern void Deallocate(IntPtr p, SwiftMetatype t);
コード例 #2
0
 public static extern void SetRemove(IntPtr retvalPtr, IntPtr self, IntPtr keyPtr, SwiftMetatype keyType, IntPtr protoWitness);
 internal static extern void InvokeFunction(BlindSwiftClosureRepresentation clos, IntPtr retval, IntPtr args, SwiftMetatype t1, SwiftMetatype t2, SwiftMetatype t3, SwiftMetatype t4,
                                            SwiftMetatype t5, SwiftMetatype t6, SwiftMetatype t7, SwiftMetatype t8,
                                            SwiftMetatype t9, SwiftMetatype t10, SwiftMetatype t11, SwiftMetatype t12,
                                            SwiftMetatype t13, SwiftMetatype t14, SwiftMetatype t15, SwiftMetatype t16, SwiftMetatype tr);
コード例 #4
0
 public static extern void NewSet(IntPtr retval, nint capacity, SwiftMetatype t, IntPtr protoWitness);
コード例 #5
0
 public static extern nint SetGetCapacity(IntPtr self, SwiftMetatype t, IntPtr protoWitness);
コード例 #6
0
 static extern MetadataResponse swift_getAssociatedTypeWitness(SwiftMetadataRequest request, SwiftProtocolWitnessTable witness,
                                                               SwiftMetatype conformingType, IntPtr conformanceBaseDescriptor, IntPtr conformanceRequest);
コード例 #7
0
 public static extern void FromAny(IntPtr resultPtr, IntPtr anyPtr, SwiftMetatype resultType);
コード例 #8
0
 static extern nint swift_strideof(IntPtr ignored, SwiftMetatype mt);
コード例 #9
0
 internal static nint StrideOf(SwiftMetatype mt)
 {
     return(swift_strideof(IntPtr.Zero, mt));
 }
コード例 #10
0
 public static extern void Advance(IntPtr retval, IntPtr p, nint by, SwiftMetatype t);
コード例 #11
0
 internal static extern IntPtr PI_EveryProtocol(SwiftMetatype metaClass);
コード例 #12
0
 public static extern void Set(IntPtr ptr, IntPtr value, SwiftMetatype t);
コード例 #13
0
 public static extern void Get(IntPtr retval, IntPtr src, SwiftMetatype t);
コード例 #14
0
 public static extern void Allocate(IntPtr retval, nint capacity, SwiftMetatype t);
コード例 #15
0
 static extern IntPtr swift_conformsToProtocol(SwiftMetatype metadata, SwiftNominalTypeDescriptor protocolDescriptor);
コード例 #16
0
 static extern nint swift_alignmentof(IntPtr ignored, SwiftMetatype mt);
コード例 #17
0
 public static SwiftProtocolWitnessTable ConformsToSwiftProtocol(SwiftMetatype metadata, SwiftNominalTypeDescriptor protocolDescriptor)
 {
     return(new SwiftProtocolWitnessTable(swift_conformsToProtocol(metadata, protocolDescriptor)));
 }
コード例 #18
0
 internal static nint AlignmentOf(SwiftMetatype mt)
 {
     return(swift_alignmentof(IntPtr.Zero, mt));
 }
コード例 #19
0
 public static extern void ToAny(IntPtr anyPtr, IntPtr argPtr, SwiftMetatype argPtrType);
コード例 #20
0
 static unsafe extern SwiftMetatype swift_getFunctionTypeMetadata(nuint flags,
                                                                  SwiftMetatype *parameters, int *parameterFlags, SwiftMetatype returnType);
コード例 #21
0
 public static extern SwiftMetatype PIMetadataAccessor_SwiftSet(SwiftMetadataRequest request, SwiftMetatype t, IntPtr protocolWitness);
コード例 #22
0
        internal static unsafe SwiftMetatype GetFunctionTypeMetadata(SwiftMetatype [] parameterTypes, int [] inOutFlags, SwiftMetatype returnType, bool throws)
        {
            nuint funcFlags = (uint)parameterTypes.Length;
            // calling convention goes in the 3rd byte. It's one of:
            // 0x000000 - swift
            // 0x010000 - block
            // 0x020000 - thin
            // 0x030000 - c
            // if we wanted to support these, we'd or them in here.

            // if the flags of parameters is useful, set it.
            bool inOutFlagsUseful = false;

            foreach (var flag in inOutFlags)
            {
                if (flag != 0)
                {
                    inOutFlagsUseful = true;
                    break;
                }
            }
            if (inOutFlagsUseful)
            {
                funcFlags |= 0x02000000;
            }
            if (throws)
            {
                funcFlags |= 0x01000000;
                // if it's escapting, or in 0x04000000

                // on no useful flags, pass in null
                fixed(int *flags = inOutFlagsUseful?inOutFlags : null)
                {
                    // on no parameters, pass in null
                    fixed(SwiftMetatype *parameters = parameterTypes.Length > 0?parameterTypes : null)
                    {
                        return(swift_getFunctionTypeMetadata(funcFlags, parameters, flags, returnType));
                    }
                }
        }
コード例 #23
0
 public static extern bool SetIsEmpty(IntPtr self, SwiftMetatype t, IntPtr protoWitness);
コード例 #24
0
 static extern bool swift_dynamicCast(IntPtr dest, IntPtr src, SwiftMetatype srcType, SwiftMetatype targetType, nint flags);
コード例 #25
0
 public static extern nint SetContains(IntPtr self, IntPtr keyPtr, SwiftMetatype keyType, IntPtr protoWitness);
コード例 #26
0
 static extern IntPtr swift_getWitnessTable(IntPtr swiftConformanceDescriptor, SwiftMetatype metadata, IntPtr extraData);
 internal static extern void InvokeFunction(BlindSwiftClosureRepresentation clos, IntPtr retval, IntPtr args, SwiftMetatype t1, SwiftMetatype t2, SwiftMetatype t3, SwiftMetatype t4, SwiftMetatype tr);
コード例 #28
0
 public static IntPtr ProtocolWitnessTableFromFile(string dylibFile, string conformanceIdentifier, SwiftMetatype metadata)
 {
     using (var dylib = new DynamicLib(dylibFile, DLOpenMode.Now)) {
         var descriptor = dylib.FindSymbolAddress(conformanceIdentifier);
         if (descriptor == IntPtr.Zero)
         {
             throw new SwiftRuntimeException($"Unable to find swift protocol conformance descriptor {conformanceIdentifier} in file {dylib}");
         }
         return(swift_getWitnessTable(descriptor, metadata, IntPtr.Zero));
     }
 }
 internal static extern void InvokeAction(BlindSwiftClosureRepresentation clos, IntPtr args, SwiftMetatype t1);
コード例 #30
0
 public static extern void Deinitialize(IntPtr p, nint count, SwiftMetatype t);