Package kotlinx.cinterop

Types

Native
1.3

Arena

class Arena : ArenaBase
Native
1.3

ArenaBase

open class ArenaBase : AutofreeScope
Native
1.3

AutofreeScope

abstract class AutofreeScope : DeferScope, NativePlacement
Native
1.3

BooleanVar

typealias BooleanVar = BooleanVarOf<Boolean>
Native
1.3

BooleanVarOf

class BooleanVarOf<T : Boolean> : CPrimitiveVar
Native
1.3

ByteVar

typealias ByteVar = ByteVarOf<Byte>
Native
1.3

ByteVarOf

class ByteVarOf<T : Byte> : CPrimitiveVar
Native
1.3

CArrayPointer

typealias CArrayPointer<T> = CPointer<T>
Native
1.3

CArrayPointerVar

typealias CArrayPointerVar<T> = CPointerVar<T>
Native
1.3

CEnum

interface CEnum
Native
1.3

CEnumVar

abstract class CEnumVar : CPrimitiveVar
Native
1.3

CFunction

The C function.

class CFunction<T : Function<*>> : CPointed
Native
1.3

COpaque

The CPointed without any specified interpretation.

abstract class COpaque : CPointed
Native
1.3

COpaquePointer

The pointer with an opaque type.

typealias COpaquePointer = CPointer<out CPointed>
Native
1.3

COpaquePointerVar

The variable containing a COpaquePointer.

typealias COpaquePointerVar = CPointerVarOf<COpaquePointer>
Native
1.3

CPlusPlusClass

interface CPlusPlusClass
Native
1.3

CPointed

C data or code.

abstract class CPointed : NativePointed
Native
1.3

CPointer

C pointer.

class CPointer<T : CPointed> : CValuesRef<T>
Native
1.3

CPointerVar

The C data variable containing the pointer to T.

typealias CPointerVar<T> = CPointerVarOf<CPointer<T>>
Native
1.3

CPointerVarOf

class CPointerVarOf<T : CPointer<*>> : CVariable
Native
1.3

CPrimitiveVar

The C primitive-typed variable located in memory.

sealed class CPrimitiveVar : CVariable
Native
1.3

CStructVar

The C struct-typed variable located in memory.

abstract class CStructVar : CVariable
Native
1.3

CValue

The single immutable C value. It is self-contained and doesn't depend on native memory.

abstract class CValue<T : CVariable> : CValues<T>
Native
1.3

CValues

The (possibly empty) sequence of immutable C values. It is self-contained and doesn't depend on native memory.

abstract class CValues<T : CVariable> : CValuesRef<T>
Native
1.3

CValuesRef

Represents a reference to (possibly empty) sequence of C values. It can be either a stable pointer CPointer or a sequence of immutable values CValues.

abstract class CValuesRef<T : CPointed>
Native
1.3

CVariable

The C data variable located in memory.

abstract class CVariable : CPointed
Native
1.3

DeferScope

open class DeferScope
Native
1.3

DoubleVar

typealias DoubleVar = DoubleVarOf<Double>
Native
1.3

DoubleVarOf

class DoubleVarOf<T : Double> : CPrimitiveVar
Native
1.3

FloatVar

typealias FloatVar = FloatVarOf<Float>
Native
1.3

FloatVarOf

class FloatVarOf<T : Float> : CPrimitiveVar
Native
1.3

ForeignException

class ForeignException : Exception
Native
1.3

IntVar

typealias IntVar = IntVarOf<Int>
Native
1.3

IntVarOf

class IntVarOf<T : Int> : CPrimitiveVar
Native
1.3

LongVar

typealias LongVar = LongVarOf<Long>
Native
1.3

LongVarOf

class LongVarOf<T : Long> : CPrimitiveVar
Native
1.3

ManagedType

abstract class ManagedType<T : CStructVar>
Native
1.3

MemScope

class MemScope : ArenaBase
Native
1.3

NativeFreeablePlacement

interface NativeFreeablePlacement : NativePlacement
Native
1.3

nativeHeap

object nativeHeap : NativeFreeablePlacement
Native
1.3

NativePlacement

interface NativePlacement
Native
1.3

NativePointed

The entity which has an associated native pointer. Subtypes are supposed to represent interpretations of the pointed data or code.

open class NativePointed
Native
1.3

NativePtr

typealias NativePtr = NativePtr
Native
1.3

ObjCBlockVar

typealias ObjCBlockVar<T> = ObjCNotImplementedVar<T>
Native
1.3

ObjCClass

interface ObjCClass : ObjCObject
Native
1.3

ObjCClassOf

interface ObjCClassOf<T : ObjCObject> : ObjCClass
Native
1.3

ObjCNotImplementedVar

class ObjCNotImplementedVar<T> : CVariable
Native
1.3

ObjCObject

interface ObjCObject
Native
1.3

ObjCObjectBase

abstract class ObjCObjectBase : ObjCObject
Native
1.3

ObjCObjectBaseMeta

abstract class ObjCObjectBaseMeta : 
    ObjCObjectBase,
    ObjCObjectMeta
Native
1.3

ObjCObjectMeta

typealias ObjCObjectMeta = ObjCClass
Native
1.3

ObjCObjectVar

class ObjCObjectVar<T> : CVariable
Native
1.3

ObjCProtocol

interface ObjCProtocol : ObjCObject
Native
1.3

ObjCStringVarOf

typealias ObjCStringVarOf<T> = ObjCNotImplementedVar<T>
Native
1.3

Pinned

data class Pinned<out T : Any>
Native
1.3

ShortVar

typealias ShortVar = ShortVarOf<Short>
Native
1.3

ShortVarOf

class ShortVarOf<T : Short> : CPrimitiveVar
Native
1.3

SkiaRefCnt

interface SkiaRefCnt
Native
1.3

StableRef

class StableRef<out T : Any>
Native
1.3

UByteVar

typealias UByteVar = UByteVarOf<UByte>
Native
1.3

UByteVarOf

class UByteVarOf<T : UByte> : CPrimitiveVar
Native
1.3

UIntVar

typealias UIntVar = UIntVarOf<UInt>
Native
1.3

UIntVarOf

class UIntVarOf<T : UInt> : CPrimitiveVar
Native
1.3

ULongVar

typealias ULongVar = ULongVarOf<ULong>
Native
1.3

ULongVarOf

class ULongVarOf<T : ULong> : CPrimitiveVar
Native
1.3

UShortVar

typealias UShortVar = UShortVarOf<UShort>
Native
1.3

UShortVarOf

class UShortVarOf<T : UShort> : CPrimitiveVar
Native
1.9

Vector128

class Vector128
Native
1.9

Vector128Var

typealias Vector128Var = Vector128VarOf<Vector128>
Native
1.9

Vector128VarOf

class Vector128VarOf<T : Vector128> : CVariable

Annotations

Native
1.3

BetaInteropApi

Marks Objective-C and Swift interoperability API as Beta.

annotation class BetaInteropApi
Native
1.3

ExperimentalForeignApi

Marks foreign-language-related API as experimental.

annotation class ExperimentalForeignApi
Native
1.3

ExportObjCClass

Makes Kotlin subclass of Objective-C class visible for runtime lookup after Kotlin main function gets invoked.

annotation class ExportObjCClass
Native
1.3

ExternalObjCClass

annotation class ExternalObjCClass
Native
1.3

InteropStubs

annotation class InteropStubs
Native
1.3

ObjCAction

Makes Kotlin method in Objective-C class accessible through Objective-C dispatch to be used as action sent by control in UIKit or AppKit.

annotation class ObjCAction
Native
1.3

ObjCConstructor

annotation class ObjCConstructor
Native
1.3

ObjCDirect

annotation class ObjCDirect
Native
1.3

ObjCFactory

annotation class ObjCFactory
Native
1.3

ObjCMethod

annotation class ObjCMethod
Native
1.3

ObjCOutlet

Makes Kotlin property in Objective-C class settable through Objective-C dispatch to be used as IB outlet.

annotation class ObjCOutlet
Native
1.3

UnsafeNumber

Marker for declarations that depend on numeric types of different bit width on at least two platforms.

annotation class UnsafeNumber

Properties

Native
1.3

cstr

val String.cstr: CValues<ByteVar>
Native
1.3

nativeNullPtr

val nativeNullPtr: NativePtr
Native
1.3

pointed

Returns the corresponding CPointed.

val <T : CPointed> CPointer<T>.pointed: T

The code or data pointed by the value of this variable.

var <T : CPointed, P : CPointer<T>> CPointerVarOf<P>.pointed: T?
Native
1.3

ptr

Returns the pointer to this data or code.

val <T : CPointed> T.ptr: CPointer<T>
val <T : CStructVar> ManagedType<T>.ptr: CPointer<T>
Native
1.3

rawPtr

Native
1.3

rawValue

val CPointer<*>?.rawValue: NativePtr
Native
1.3

utf16

val String.utf16: CValues<UShortVar>
Native
1.3

utf32

val String.utf32: CValues<IntVar>
Native
1.3

utf8

val String.utf8: CValues<ByteVar>
Native
1.3

value

var <T : Boolean> BooleanVarOf<T>.value: T
var <T : Byte> ByteVarOf<T>.value: T
var <T : Short> ShortVarOf<T>.value: T
var <T : Int> IntVarOf<T>.value: T
var <T : Long> LongVarOf<T>.value: T
var <T : UByte> UByteVarOf<T>.value: T
var <T : UShort> UShortVarOf<T>.value: T
var <T : UInt> UIntVarOf<T>.value: T
var <T : ULong> ULongVarOf<T>.value: T
var <T : Float> FloatVarOf<T>.value: T
var <T : Double> DoubleVarOf<T>.value: T
var <T> ObjCNotImplementedVar<T>.value: T
var <T> ObjCObjectVar<T>.value: T
var <T : Vector128> Vector128VarOf<T>.value: T

The value of this variable.

var <P : CPointer<*>> CPointerVarOf<P>.value: P?
Native
1.3

wcstr

val String.wcstr: CValues<UShortVar>

Functions

Native
1.3

addressOf

fun Pinned<ByteArray>.addressOf(
    index: Int
): CPointer<ByteVar>
fun Pinned<String>.addressOf(index: Int): CPointer<COpaque>
fun Pinned<CharArray>.addressOf(
    index: Int
): CPointer<COpaque>
fun Pinned<ShortArray>.addressOf(
    index: Int
): CPointer<ShortVar>
fun Pinned<IntArray>.addressOf(index: Int): CPointer<IntVar>
fun Pinned<LongArray>.addressOf(
    index: Int
): CPointer<LongVar>
fun Pinned<UByteArray>.addressOf(
    index: Int
): CPointer<UByteVar>
fun Pinned<UShortArray>.addressOf(
    index: Int
): CPointer<UShortVar>
fun Pinned<UIntArray>.addressOf(
    index: Int
): CPointer<UIntVar>
fun Pinned<ULongArray>.addressOf(
    index: Int
): CPointer<ULongVar>
fun Pinned<FloatArray>.addressOf(
    index: Int
): CPointer<FloatVar>
fun Pinned<DoubleArray>.addressOf(
    index: Int
): CPointer<DoubleVar>
Native
1.3

alignOf

fun <T : CVariable> alignOf(): Int
Native
1.3

alloc

Allocates variable of given type.

fun <T : CVariable> NativePlacement.alloc(): T

Allocates variable of given type and initializes it applying given block.

fun <T : CVariable> NativePlacement.alloc(
    initialize: T.() -> Unit
): T

Allocates variable with given value type and initializes it with given value.

fun <T : Boolean> NativePlacement.alloc(
    value: T
): BooleanVarOf<T>
Native
1.3

allocArray

Allocates C array of given elements type and length.

fun <T : CVariable> NativePlacement.allocArray(
    length: Long
): CArrayPointer<T>
fun <T : CVariable> NativePlacement.allocArray(
    length: Int
): CArrayPointer<T>

Allocates C array of given elements type and length, and initializes its elements applying given block.

fun <T : CVariable> NativePlacement.allocArray(
    length: Long,
    initializer: T.(index: Long) -> Unit
): CArrayPointer<T>
fun <T : CVariable> NativePlacement.allocArray(
    length: Int,
    initializer: T.(index: Int) -> Unit
): CArrayPointer<T>
Native
1.3

allocArrayOf

Allocates C array of given values.

fun <T : CPointer<*>> NativePlacement.allocArrayOf(
    vararg elements: T?
): CArrayPointer<CPointerVarOf<T>>
fun <T : CPointer<*>> NativePlacement.allocArrayOf(
    elements: List<T?>
): CArrayPointer<CPointerVarOf<T>>
fun NativePlacement.allocArrayOf(
    elements: ByteArray
): CArrayPointer<ByteVar>
fun NativePlacement.allocArrayOf(
    vararg elements: Float
): CArrayPointer<FloatVar>
Native
1.3

allocArrayOfPointersTo

Allocates C array of pointers to given elements.

fun <T : CPointed> NativePlacement.allocArrayOfPointersTo(
    elements: List<T?>
): CArrayPointer<CPointerVar<T>>
fun <T : CPointed> NativePlacement.allocArrayOfPointersTo(
    vararg elements: T?
): CArrayPointer<CPointerVar<T>>
Native
1.3

allocPointerTo

fun <T : CPointed> NativePlacement.allocPointerTo(): CPointerVar<T>
Native
1.3

arrayMemberAt

fun <T : CVariable> CStructVar.arrayMemberAt(
    offset: Long
): CArrayPointer<T>
Native
1.3

asStableRef

Converts to StableRef this opaque pointer produced by StableRef.asCPointer.

fun <T : Any> CPointer<*>.asStableRef(): StableRef<T>
Native
1.3

autoreleasepool

fun <R> autoreleasepool(block: () -> R): R
Native
1.3

bitsToDouble

fun bitsToDouble(bits: Long): Double
Native
1.3

bitsToFloat

fun bitsToFloat(bits: Int): Float
Native
1.3

convert

fun <R : Any> Byte.convert(): R
fun <R : Any> Short.convert(): R
fun <R : Any> Int.convert(): R
fun <R : Any> Long.convert(): R
fun <R : Any> UByte.convert(): R
fun <R : Any> UShort.convert(): R
fun <R : Any> UInt.convert(): R
fun <R : Any> ULong.convert(): R
Native
1.3

copy

fun <T : CStructVar> CValue<T>.copy(
    modify: T.() -> Unit
): CValue<T>
Native
1.3

createKotlinObjectHolder

fun createKotlinObjectHolder(any: Any?): NativePtr
Native
1.3

CreateKStringFromNSString

fun CreateKStringFromNSString(ptr: NativePtr): String?
Native
1.3

CreateNSStringFromKString

fun CreateNSStringFromKString(str: String?): NativePtr
Native
1.3

createValues

fun <T : CVariable> createValues(
    count: Int,
    initializer: T.(index: Int) -> Unit
): CValues<T>
Native
1.3

cValue

fun <T : CVariable> cValue(): CValue<T>
fun <T : CStructVar> cValue(
    initialize: T.() -> Unit
): CValue<T>
Native
1.3

cValuesOf

Returns sequence of immutable values CValues to pass them to C code.

fun cValuesOf(vararg elements: Byte): CValues<ByteVar>
fun cValuesOf(vararg elements: Short): CValues<ShortVar>
fun cValuesOf(vararg elements: Int): CValues<IntVar>
fun cValuesOf(vararg elements: Long): CValues<LongVar>
fun cValuesOf(vararg elements: Float): CValues<FloatVar>
fun cValuesOf(vararg elements: Double): CValues<DoubleVar>
fun <T : CPointed> cValuesOf(
    vararg elements: CPointer<T>?
): CValues<CPointerVar<T>>
fun cValuesOf(vararg elements: UByte): CValues<UByteVar>
fun cValuesOf(vararg elements: UShort): CValues<UShortVar>
fun cValuesOf(vararg elements: UInt): CValues<UIntVar>
fun cValuesOf(vararg elements: ULong): CValues<ULongVar>
Native
1.3

free

fun NativeFreeablePlacement.free(pointer: CPointer<*>)
Native
1.3

get

operator fun <T : Byte> CPointer<ByteVarOf<T>>.get(
    index: Int
): T
operator fun <T : Byte> CPointer<ByteVarOf<T>>.get(
    index: Long
): T
operator fun <T : Short> CPointer<ShortVarOf<T>>.get(
    index: Int
): T
operator fun <T : Short> CPointer<ShortVarOf<T>>.get(
    index: Long
): T
operator fun <T : Int> CPointer<IntVarOf<T>>.get(
    index: Int
): T
operator fun <T : Int> CPointer<IntVarOf<T>>.get(
    index: Long
): T
operator fun <T : Long> CPointer<LongVarOf<T>>.get(
    index: Int
): T
operator fun <T : Long> CPointer<LongVarOf<T>>.get(
    index: Long
): T
operator fun <T : UByte> CPointer<UByteVarOf<T>>.get(
    index: Int
): T
operator fun <T : UByte> CPointer<UByteVarOf<T>>.get(
    index: Long
): T
operator fun <T : UShort> CPointer<UShortVarOf<T>>.get(
    index: Int
): T
operator fun <T : UShort> CPointer<UShortVarOf<T>>.get(
    index: Long
): T
operator fun <T : UInt> CPointer<UIntVarOf<T>>.get(
    index: Int
): T
operator fun <T : UInt> CPointer<UIntVarOf<T>>.get(
    index: Long
): T
operator fun <T : ULong> CPointer<ULongVarOf<T>>.get(
    index: Int
): T
operator fun <T : ULong> CPointer<ULongVarOf<T>>.get(
    index: Long
): T
operator fun <T : Float> CPointer<FloatVarOf<T>>.get(
    index: Int
): T
operator fun <T : Float> CPointer<FloatVarOf<T>>.get(
    index: Long
): T
operator fun <T : Double> CPointer<DoubleVarOf<T>>.get(
    index: Int
): T
operator fun <T : Double> CPointer<DoubleVarOf<T>>.get(
    index: Long
): T
operator fun <T : CVariable> CPointer<T>.get(index: Long): T
operator fun <T : CVariable> CPointer<T>.get(index: Int): T
operator fun <T : CPointer<*>> CPointer<CPointerVarOf<T>>.get(
    index: Int
): T?
operator fun <T : CPointer<*>> CPointer<CPointerVarOf<T>>.get(
    index: Long
): T?
Native
1.3

getBytes

fun <T : CVariable> CValues<T>.getBytes(): ByteArray
Native
1.3

getOriginalKotlinClass

If objCClass is a class generated to Objective-C header for Kotlin class, returns KClass for that original Kotlin class.

fun getOriginalKotlinClass(objCClass: ObjCClass): KClass<*>?

If objCProtocol is a protocol generated to Objective-C header for Kotlin class, returns KClass for that original Kotlin class.

fun getOriginalKotlinClass(
    objCProtocol: ObjCProtocol
): KClass<*>?
Native
1.3

getRawPointer

fun NativePointed.getRawPointer(): NativePtr
Native
1.3

getRawValue

fun CPointer<*>.getRawValue(): NativePtr
Native
1.3

initBy

fun <T : ObjCObjectBase> T.initBy(constructorCall: T): T
Native
1.3

interpretCPointer

Performs type cast of the CPointer from the given raw pointer.

fun <T : CPointed> interpretCPointer(
    rawValue: NativePtr
): CPointer<T>?
Native
1.3

interpretNullableOpaquePointed

fun interpretNullableOpaquePointed(
    ptr: NativePtr
): NativePointed?
Native
1.3

interpretNullablePointed

Performs type cast of the native pointer to given interop type, including null values.

fun <T : NativePointed> interpretNullablePointed(
    ptr: NativePtr
): T?
Native
1.3

interpretObjCPointer

fun <T : Any> interpretObjCPointer(objcPtr: NativePtr): T
Native
1.3

interpretObjCPointerOrNull

fun <T> interpretObjCPointerOrNull(objcPtr: NativePtr): T?
Native
1.3

interpretOpaquePointed

fun interpretOpaquePointed(ptr: NativePtr): NativePointed
Native
1.3

interpretPointed

Returns interpretation of entity with given pointer.

fun <T : NativePointed> interpretPointed(ptr: NativePtr): T
Native
1.3

invoke

operator fun <R> CPointer<CFunction<() -> R>>.invoke(): R
operator fun <P1, R> CPointer<CFunction<(P1) -> R>>.invoke(
    p1: P1
): R
operator fun <P1, P2, R> CPointer<CFunction<(P1, P2) -> R>>.invoke(
    p1: P1,
    p2: P2
): R
operator fun <P1, P2, P3, R> CPointer<CFunction<(P1, P2, P3) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3
): R
operator fun <P1, P2, P3, P4, R> CPointer<CFunction<(P1, P2, P3, P4) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4
): R
operator fun <P1, P2, P3, P4, P5, R> CPointer<CFunction<(P1, P2, P3, P4, P5) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5
): R
operator fun <P1, P2, P3, P4, P5, P6, R> CPointer<CFunction<(P1, P2, P3, P4, P5, P6) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5,
    p6: P6
): R
operator fun <P1, P2, P3, P4, P5, P6, P7, R> CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5,
    p6: P6,
    p7: P7
): R
operator fun <P1, P2, P3, P4, P5, P6, P7, P8, R> CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5,
    p6: P6,
    p7: P7,
    p8: P8
): R
operator fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, R> CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5,
    p6: P6,
    p7: P7,
    p8: P8,
    p9: P9
): R
operator fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, R> CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5,
    p6: P6,
    p7: P7,
    p8: P8,
    p9: P9,
    p10: P10
): R
operator fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, R> CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5,
    p6: P6,
    p7: P7,
    p8: P8,
    p9: P9,
    p10: P10,
    p11: P11
): R
operator fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, R> CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5,
    p6: P6,
    p7: P7,
    p8: P8,
    p9: P9,
    p10: P10,
    p11: P11,
    p12: P12
): R
operator fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, R> CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5,
    p6: P6,
    p7: P7,
    p8: P8,
    p9: P9,
    p10: P10,
    p11: P11,
    p12: P12,
    p13: P13
): R
operator fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, R> CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5,
    p6: P6,
    p7: P7,
    p8: P8,
    p9: P9,
    p10: P10,
    p11: P11,
    p12: P12,
    p13: P13,
    p14: P14
): R
operator fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, R> CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5,
    p6: P6,
    p7: P7,
    p8: P8,
    p9: P9,
    p10: P10,
    p11: P11,
    p12: P12,
    p13: P13,
    p14: P14,
    p15: P15
): R
operator fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, R> CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5,
    p6: P6,
    p7: P7,
    p8: P8,
    p9: P9,
    p10: P10,
    p11: P11,
    p12: P12,
    p13: P13,
    p14: P14,
    p15: P15,
    p16: P16
): R
operator fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, R> CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5,
    p6: P6,
    p7: P7,
    p8: P8,
    p9: P9,
    p10: P10,
    p11: P11,
    p12: P12,
    p13: P13,
    p14: P14,
    p15: P15,
    p16: P16,
    p17: P17
): R
operator fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, R> CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5,
    p6: P6,
    p7: P7,
    p8: P8,
    p9: P9,
    p10: P10,
    p11: P11,
    p12: P12,
    p13: P13,
    p14: P14,
    p15: P15,
    p16: P16,
    p17: P17,
    p18: P18
): R
operator fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, R> CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5,
    p6: P6,
    p7: P7,
    p8: P8,
    p9: P9,
    p10: P10,
    p11: P11,
    p12: P12,
    p13: P13,
    p14: P14,
    p15: P15,
    p16: P16,
    p17: P17,
    p18: P18,
    p19: P19
): R
operator fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, R> CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5,
    p6: P6,
    p7: P7,
    p8: P8,
    p9: P9,
    p10: P10,
    p11: P11,
    p12: P12,
    p13: P13,
    p14: P14,
    p15: P15,
    p16: P16,
    p17: P17,
    p18: P18,
    p19: P19,
    p20: P20
): R
operator fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, R> CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5,
    p6: P6,
    p7: P7,
    p8: P8,
    p9: P9,
    p10: P10,
    p11: P11,
    p12: P12,
    p13: P13,
    p14: P14,
    p15: P15,
    p16: P16,
    p17: P17,
    p18: P18,
    p19: P19,
    p20: P20,
    p21: P21
): R
operator fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22, R> CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22) -> R>>.invoke(
    p1: P1,
    p2: P2,
    p3: P3,
    p4: P4,
    p5: P5,
    p6: P6,
    p7: P7,
    p8: P8,
    p9: P9,
    p10: P10,
    p11: P11,
    p12: P12,
    p13: P13,
    p14: P14,
    p15: P15,
    p16: P16,
    p17: P17,
    p18: P18,
    p19: P19,
    p20: P20,
    p21: P21,
    p22: P22
): R
Native
1.3

memberAt

Returns the member of this CStructVar which is located by given offset in bytes.

fun <T : CPointed> CStructVar.memberAt(offset: Long): T
Native
1.3

memScoped

Runs given block providing allocation of memory which will be automatically disposed at the end of this scope.

fun <R> memScoped(block: MemScope.() -> R): R
Native
1.3

narrow

fun <R : Number> Number.narrow(): R
Native
1.3

objc_autoreleasePoolPop

fun objc_autoreleasePoolPop(ptr: NativePtr)
Native
1.3

objc_autoreleasePoolPush

fun objc_autoreleasePoolPush(): NativePtr
Native
1.3

objc_release

fun objc_release(ptr: NativePtr)
Native
1.3

objc_retain

fun objc_retain(ptr: NativePtr): NativePtr
Native
1.3

objc_retainAutoreleaseReturnValue

fun objc_retainAutoreleaseReturnValue(
    ptr: NativePtr
): NativePtr
Native
1.3

objcPtr

fun Any?.objcPtr(): NativePtr
Native
1.3

optional

fun optional(): Nothing
Native
1.3

pin

fun <T : Any> T.pin(): Pinned<T>
Native
1.3

placeTo

fun <T : CVariable> CValues<T>.placeTo(
    scope: AutofreeScope
): CPointer<T>
Native
1.3

plus

operator fun <T : ByteVarOf<*>> CPointer<T>?.plus(
    index: Long
): CPointer<T>?
operator fun <T : ByteVarOf<*>> CPointer<T>?.plus(
    index: Int
): CPointer<T>?
Native
1.3

readBits

fun readBits(
    ptr: NativePtr,
    offset: Long,
    size: Int,
    signed: Boolean
): Long
Native
1.3

readBytes

fun COpaquePointer.readBytes(count: Int): ByteArray
Native
1.3

readValue

fun <T : CVariable> CPointed.readValue(
    size: Long,
    align: Int
): CValue<T>
fun <T : CStructVar> T.readValue(): CValue<T>
Native
1.3

readValues

fun <T : CVariable> CPointed.readValues(
    size: Int,
    align: Int
): CValues<T>
fun <T : CVariable> T.readValues(count: Int): CValues<T>
Native
1.3

refTo

fun ByteArray.refTo(index: Int): CValuesRef<ByteVar>
fun String.refTo(index: Int): CValuesRef<COpaque>
fun CharArray.refTo(index: Int): CValuesRef<COpaque>
fun ShortArray.refTo(index: Int): CValuesRef<ShortVar>
fun IntArray.refTo(index: Int): CValuesRef<IntVar>
fun LongArray.refTo(index: Int): CValuesRef<LongVar>
fun UByteArray.refTo(index: Int): CValuesRef<UByteVar>
fun UShortArray.refTo(index: Int): CValuesRef<UShortVar>
fun UIntArray.refTo(index: Int): CValuesRef<UIntVar>
fun ULongArray.refTo(index: Int): CValuesRef<ULongVar>
fun FloatArray.refTo(index: Int): CValuesRef<FloatVar>
fun DoubleArray.refTo(index: Int): CValuesRef<DoubleVar>
Native
1.3

reinterpret

Changes the interpretation of the pointed data or code.

fun <T : NativePointed> NativePointed.reinterpret(): T
fun <T : CPointed> CPointer<*>.reinterpret(): CPointer<T>
Native
1.3

set

operator fun <T : Byte> CPointer<ByteVarOf<T>>.set(
    index: Int,
    value: T)
operator fun <T : Byte> CPointer<ByteVarOf<T>>.set(
    index: Long,
    value: T)
operator fun <T : Short> CPointer<ShortVarOf<T>>.set(
    index: Int,
    value: T)
operator fun <T : Short> CPointer<ShortVarOf<T>>.set(
    index: Long,
    value: T)
operator fun <T : Int> CPointer<IntVarOf<T>>.set(
    index: Int,
    value: T)
operator fun <T : Int> CPointer<IntVarOf<T>>.set(
    index: Long,
    value: T)
operator fun <T : Long> CPointer<LongVarOf<T>>.set(
    index: Int,
    value: T)
operator fun <T : Long> CPointer<LongVarOf<T>>.set(
    index: Long,
    value: T)
operator fun <T : UByte> CPointer<UByteVarOf<T>>.set(
    index: Int,
    value: T)
operator fun <T : UByte> CPointer<UByteVarOf<T>>.set(
    index: Long,
    value: T)
operator fun <T : UShort> CPointer<UShortVarOf<T>>.set(
    index: Int,
    value: T)
operator fun <T : UShort> CPointer<UShortVarOf<T>>.set(
    index: Long,
    value: T)
operator fun <T : UInt> CPointer<UIntVarOf<T>>.set(
    index: Int,
    value: T)
operator fun <T : UInt> CPointer<UIntVarOf<T>>.set(
    index: Long,
    value: T)
operator fun <T : ULong> CPointer<ULongVarOf<T>>.set(
    index: Int,
    value: T)
operator fun <T : ULong> CPointer<ULongVarOf<T>>.set(
    index: Long,
    value: T)
operator fun <T : Float> CPointer<FloatVarOf<T>>.set(
    index: Int,
    value: T)
operator fun <T : Float> CPointer<FloatVarOf<T>>.set(
    index: Long,
    value: T)
operator fun <T : Double> CPointer<DoubleVarOf<T>>.set(
    index: Int,
    value: T)
operator fun <T : Double> CPointer<DoubleVarOf<T>>.set(
    index: Long,
    value: T)
operator fun <T : CPointer<*>> CPointer<CPointerVarOf<T>>.set(
    index: Int,
    value: T?)
operator fun <T : CPointer<*>> CPointer<CPointerVarOf<T>>.set(
    index: Long,
    value: T?)
Native
1.3

signExtend

fun <R : Number> Number.signExtend(): R
Native
1.3

sizeOf

fun <T : CVariable> sizeOf(): Long
Native
1.3

staticCFunction

Returns a pointer to C function which calls given Kotlin static function.

fun <R> staticCFunction(
    function: () -> R
): CPointer<CFunction<() -> R>>
fun <P1, R> staticCFunction(
    function: (P1) -> R
): CPointer<CFunction<(P1) -> R>>
fun <P1, P2, R> staticCFunction(
    function: (P1, P2) -> R
): CPointer<CFunction<(P1, P2) -> R>>
fun <P1, P2, P3, R> staticCFunction(
    function: (P1, P2, P3) -> R
): CPointer<CFunction<(P1, P2, P3) -> R>>
fun <P1, P2, P3, P4, R> staticCFunction(
    function: (P1, P2, P3, P4) -> R
): CPointer<CFunction<(P1, P2, P3, P4) -> R>>
fun <P1, P2, P3, P4, P5, R> staticCFunction(
    function: (P1, P2, P3, P4, P5) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5) -> R>>
fun <P1, P2, P3, P4, P5, P6, R> staticCFunction(
    function: (P1, P2, P3, P4, P5, P6) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5, P6) -> R>>
fun <P1, P2, P3, P4, P5, P6, P7, R> staticCFunction(
    function: (P1, P2, P3, P4, P5, P6, P7) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7) -> R>>
fun <P1, P2, P3, P4, P5, P6, P7, P8, R> staticCFunction(
    function: (P1, P2, P3, P4, P5, P6, P7, P8) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8) -> R>>
fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, R> staticCFunction(
    function: (P1, P2, P3, P4, P5, P6, P7, P8, P9) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9) -> R>>
fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, R> staticCFunction(
    function: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) -> R>>
fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, R> staticCFunction(
    function: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11) -> R>>
fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, R> staticCFunction(
    function: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12) -> R>>
fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, R> staticCFunction(
    function: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13) -> R>>
fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, R> staticCFunction(
    function: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14) -> R>>
fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, R> staticCFunction(
    function: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15) -> R>>
fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, R> staticCFunction(
    function: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16) -> R>>
fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, R> staticCFunction(
    function: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17) -> R>>
fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, R> staticCFunction(
    function: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18) -> R>>
fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, R> staticCFunction(
    function: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19) -> R>>
fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, R> staticCFunction(
    function: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20) -> R>>
fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, R> staticCFunction(
    function: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21) -> R>>
fun <P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22, R> staticCFunction(
    function: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22) -> R
): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22) -> R>>
Native
1.3

toBoolean

fun Byte.toBoolean(): Boolean
Native
1.3

toByte

fun Boolean.toByte(): Byte
Native
1.3

toCPointer

fun <T : CPointed> Long.toCPointer(): CPointer<T>?
Native
1.3

toCStringArray

Convert this list of Kotlin strings to C array of C strings, allocating memory for the array and C strings with given AutofreeScope.

fun List<String>.toCStringArray(
    autofreeScope: AutofreeScope
): CPointer<CPointerVar<ByteVar>>

Convert this array of Kotlin strings to C array of C strings, allocating memory for the array and C strings with given AutofreeScope.

fun Array<String>.toCStringArray(
    autofreeScope: AutofreeScope
): CPointer<CPointerVar<ByteVar>>
Native
1.3

toCValues

fun ByteArray.toCValues(): CValues<ByteVar>
fun ShortArray.toCValues(): CValues<ShortVar>
fun IntArray.toCValues(): CValues<IntVar>
fun LongArray.toCValues(): CValues<LongVar>
fun FloatArray.toCValues(): CValues<FloatVar>
fun DoubleArray.toCValues(): CValues<DoubleVar>
fun <T : CPointed> Array<CPointer<T>?>.toCValues(): CValues<CPointerVar<T>>
fun <T : CPointed> List<CPointer<T>?>.toCValues(): CValues<CPointerVar<T>>
fun UByteArray.toCValues(): CValues<UByteVar>
fun UShortArray.toCValues(): CValues<UShortVar>
fun UIntArray.toCValues(): CValues<UIntVar>
fun ULongArray.toCValues(): CValues<ULongVar>
Native
1.3

toKString

fun CPointer<ByteVar>.toKString(): String
fun CPointer<ShortVar>.toKString(): String
fun CPointer<UShortVar>.toKString(): String

Decodes a string from the bytes in UTF-8 encoding in this array. Bytes following the first occurrence of 0 byte, if it occurs, are not decoded.

fun ByteArray.toKString(): String

Decodes a string from the bytes in UTF-8 encoding in this array or its subrange. Bytes following the first occurrence of 0 byte, if it occurs, are not decoded.

fun ByteArray.toKString(
    startIndex: Int = 0,
    endIndex: Int = this.size,
    throwOnInvalidSequence: Boolean = false
): String
Native
1.3

toKStringFromUtf16

fun CPointer<ShortVar>.toKStringFromUtf16(): String
fun CPointer<UShortVar>.toKStringFromUtf16(): String
Native
1.3

toKStringFromUtf32

fun CPointer<IntVar>.toKStringFromUtf32(): String
Native
1.3

toKStringFromUtf8

fun CPointer<ByteVar>.toKStringFromUtf8(): String
Native
1.3

toLong

fun <T : CPointed> CPointer<T>?.toLong(): Long
Native
1.3

typeOf

fun <T : CVariable> typeOf(): Type
Native
1.3

unwrapKotlinObjectHolder

fun <T : Any> unwrapKotlinObjectHolder(holder: Any?): T
Native
1.3

useContents

Calls the block with temporary copy of this value as receiver.

fun <T : CStructVar, R> CValue<T>.useContents(
    block: T.() -> R
): R
Native
1.3

usePinned

fun <T : Any, R> T.usePinned(block: (Pinned<T>) -> R): R
Native
1.9

vectorOf

fun vectorOf(
    f0: Float,
    f1: Float,
    f2: Float,
    f3: Float
): Vector128
fun vectorOf(f0: Int, f1: Int, f2: Int, f3: Int): Vector128
Native
1.3

write

fun <T : CVariable> CValue<T>.write(location: NativePtr)
Native
1.3

writeBits

fun writeBits(
    ptr: NativePtr,
    offset: Long,
    size: Int,
    value: Long)
Native
1.3

zeroValue

fun <T : CVariable> zeroValue(
    size: Int,
    align: Int
): CValue<T>
fun <T : CVariable> zeroValue(): CValue<T>