public static extern void Deallocate(IntPtr p, SwiftMetatype t);
Ejemplo n.º 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);
Ejemplo n.º 4
0
 public static extern void NewSet(IntPtr retval, nint capacity, SwiftMetatype t, IntPtr protoWitness);
Ejemplo n.º 5
0
 public static extern nint SetGetCapacity(IntPtr self, SwiftMetatype t, IntPtr protoWitness);
Ejemplo n.º 6
0
 static extern MetadataResponse swift_getAssociatedTypeWitness(SwiftMetadataRequest request, SwiftProtocolWitnessTable witness,
                                                               SwiftMetatype conformingType, IntPtr conformanceBaseDescriptor, IntPtr conformanceRequest);
 public static extern void FromAny(IntPtr resultPtr, IntPtr anyPtr, SwiftMetatype resultType);
Ejemplo n.º 8
0
 static extern nint swift_strideof(IntPtr ignored, SwiftMetatype mt);
Ejemplo n.º 9
0
 internal static nint StrideOf(SwiftMetatype mt)
 {
     return(swift_strideof(IntPtr.Zero, mt));
 }
 public static extern void Advance(IntPtr retval, IntPtr p, nint by, SwiftMetatype t);
 internal static extern IntPtr PI_EveryProtocol(SwiftMetatype metaClass);
 public static extern void Set(IntPtr ptr, IntPtr value, SwiftMetatype t);
 public static extern void Get(IntPtr retval, IntPtr src, SwiftMetatype t);
 public static extern void Allocate(IntPtr retval, nint capacity, SwiftMetatype t);
Ejemplo n.º 15
0
 static extern IntPtr swift_conformsToProtocol(SwiftMetatype metadata, SwiftNominalTypeDescriptor protocolDescriptor);
Ejemplo n.º 16
0
 static extern nint swift_alignmentof(IntPtr ignored, SwiftMetatype mt);
Ejemplo n.º 17
0
 public static SwiftProtocolWitnessTable ConformsToSwiftProtocol(SwiftMetatype metadata, SwiftNominalTypeDescriptor protocolDescriptor)
 {
     return(new SwiftProtocolWitnessTable(swift_conformsToProtocol(metadata, protocolDescriptor)));
 }
Ejemplo n.º 18
0
 internal static nint AlignmentOf(SwiftMetatype mt)
 {
     return(swift_alignmentof(IntPtr.Zero, mt));
 }
 public static extern void ToAny(IntPtr anyPtr, IntPtr argPtr, SwiftMetatype argPtrType);
Ejemplo n.º 20
0
 static unsafe extern SwiftMetatype swift_getFunctionTypeMetadata(nuint flags,
                                                                  SwiftMetatype *parameters, int *parameterFlags, SwiftMetatype returnType);
Ejemplo n.º 21
0
 public static extern SwiftMetatype PIMetadataAccessor_SwiftSet(SwiftMetadataRequest request, SwiftMetatype t, IntPtr protocolWitness);
Ejemplo n.º 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));
                    }
                }
        }
Ejemplo n.º 23
0
 public static extern bool SetIsEmpty(IntPtr self, SwiftMetatype t, IntPtr protoWitness);
Ejemplo n.º 24
0
 static extern bool swift_dynamicCast(IntPtr dest, IntPtr src, SwiftMetatype srcType, SwiftMetatype targetType, nint flags);
Ejemplo n.º 25
0
 public static extern nint SetContains(IntPtr self, IntPtr keyPtr, SwiftMetatype keyType, IntPtr protoWitness);
Ejemplo n.º 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);
Ejemplo n.º 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);
 public static extern void Deinitialize(IntPtr p, nint count, SwiftMetatype t);