Package-level declarations

Types

Link copied to clipboard
class Arena(parent: NativeFreeablePlacement = nativeHeap) : ArenaBase
Link copied to clipboard
open class ArenaBase(parent: NativeFreeablePlacement = nativeHeap) : AutofreeScope
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
typealias ByteVar = ByteVarOf<Byte>
Link copied to clipboard
class ByteVarOf<T : Byte>(rawPtr: NativePtr) : CPrimitiveVar
Link copied to clipboard
typealias CArrayPointer<T> = CPointer<T>
Link copied to clipboard
Link copied to clipboard
interface CEnum
Link copied to clipboard
abstract class CEnumVar(rawPtr: NativePtr) : CPrimitiveVar
Link copied to clipboard
class CFunction<T : Function<*>>(rawPtr: NativePtr) : CPointed

The C function.

Link copied to clipboard
abstract class COpaque(rawPtr: NativePtr) : CPointed

The CPointed without any specified interpretation.

Link copied to clipboard

The pointer with an opaque type.

Link copied to clipboard

The variable containing a COpaquePointer.

Link copied to clipboard
abstract class CPointed(rawPtr: NativePtr) : NativePointed

C data or code.

Link copied to clipboard

C pointer.

Link copied to clipboard

The C data variable containing the pointer to T.

Link copied to clipboard
class CPointerVarOf<T : CPointer<*>>(rawPtr: NativePtr) : CVariable
Link copied to clipboard
sealed class CPrimitiveVar : CVariable

The C primitive-typed variable located in memory.

Link copied to clipboard
abstract class CStructVar(rawPtr: NativePtr) : CVariable

The C struct-typed variable located in memory.

Link copied to clipboard
abstract class CValue<T : CVariable> : CValues<T>

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

Link copied to clipboard
abstract class CValues<T : CVariable> : CValuesRef<T>

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

Link copied to clipboard
abstract class CValuesRef<T : CPointed>

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.

Link copied to clipboard
abstract class CVariable(rawPtr: NativePtr) : CPointed

The C data variable located in memory.

Link copied to clipboard
open class DeferScope
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class ExportObjCClass(val name: String = "")

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

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class ExternalObjCClass(val protocolGetter: String = "", val binaryName: String = "")
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FILE])
annotation class InteropStubs
Link copied to clipboard
typealias IntVar = IntVarOf<Int>
Link copied to clipboard
class IntVarOf<T : Int>(rawPtr: NativePtr) : CPrimitiveVar
Link copied to clipboard
typealias LongVar = LongVarOf<Long>
Link copied to clipboard
class LongVarOf<T : Long>(rawPtr: NativePtr) : CPrimitiveVar
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
interface NativePlacement
Link copied to clipboard
open class NativePointed

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

Link copied to clipboard
typealias NativePtr = kotlin.native.internal.NativePtr
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class 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.

Link copied to clipboard
Link copied to clipboard
interface ObjCClass : ObjCObject
Link copied to clipboard
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CONSTRUCTOR])
annotation class ObjCConstructor(val initSelector: String, val designated: Boolean)
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class ObjCFactory(    val selector: String,     val encoding: String,     val isStret: Boolean = false)
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER])
annotation class ObjCMethod(    val selector: String,     val encoding: String,     val isStret: Boolean = false)
Link copied to clipboard
Link copied to clipboard
interface ObjCObject
Link copied to clipboard
abstract class ObjCObjectBase : ObjCObject
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.PROPERTY])
annotation class ObjCOutlet

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class Pinned<out T : Any>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
typealias StableObjPtr = StableRef<*>
Link copied to clipboard
@JvmInline
value class StableRef<out T : Any>

This class provides a way to create a stable handle to any Kotlin object. After converting to CPointer it can be safely passed to native code e.g. to be received in a Kotlin callback.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
typealias UIntVar = UIntVarOf<UInt>
Link copied to clipboard
class UIntVarOf<T : UInt>(rawPtr: NativePtr) : CPrimitiveVar
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
inline fun <T : CVariable> alignOf(): Int
Link copied to clipboard
inline fun <T : CVariable> NativePlacement.alloc(): T

Allocates variable of given type.

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

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

Link copied to clipboard

Allocates C array of given elements type and length.

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

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

Link copied to clipboard
inline fun <T : CPointer<*>> NativePlacement.allocArrayOf(vararg elements: T?): CArrayPointer<CPointerVarOf<T>>

Allocates C array of given values.

Link copied to clipboard

Allocates C array of pointers to given elements.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <T : Any> CPointer<*>.asStableRef(): StableRef<T>

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

Link copied to clipboard
inline fun <R> autoreleasepool(block: () -> R): R
Link copied to clipboard
external fun bitsToDouble(bits: Long): Double
Link copied to clipboard
external fun bitsToFloat(bits: Int): Float
Link copied to clipboard
inline external fun <R : Any> Byte.convert(): R
inline external fun <R : Any> Int.convert(): R
inline external fun <R : Any> Long.convert(): R
inline external fun <R : Any> Short.convert(): R
inline external fun <R : Any> UByte.convert(): R
inline external fun <R : Any> UInt.convert(): R
inline external fun <R : Any> ULong.convert(): R
inline external fun <R : Any> UShort.convert(): R
Link copied to clipboard
inline fun <T : CStructVar> CValue<T>.copy(modify: T.() -> Unit): CValue<T>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <T : CVariable> createValues(count: Int, initializer: T.(index: Int) -> Unit): CValues<T>
Link copied to clipboard
inline fun <T : CVariable> cValue(): CValue<T>
inline fun <T : CStructVar> cValue(initialize: T.() -> Unit): CValue<T>
Link copied to clipboard
fun <T : CPointed> cValuesOf(vararg elements: CPointer<T>?): CValues<CPointerVar<T>>
fun cValuesOf(vararg elements: Double): CValues<DoubleVar>
fun cValuesOf(vararg elements: Float): CValues<FloatVar>
fun cValuesOf(vararg elements: Int): CValues<IntVar>
fun cValuesOf(vararg elements: Long): CValues<LongVar>
fun cValuesOf(vararg elements: Short): CValues<ShortVar>
fun cValuesOf(vararg elements: UByte): CValues<UByteVar>
fun cValuesOf(vararg elements: UInt): CValues<UIntVar>
fun cValuesOf(vararg elements: ULong): CValues<ULongVar>
fun cValuesOf(vararg elements: UShort): CValues<UShortVar>

fun cValuesOf(vararg elements: Byte): CValues<ByteVar>

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

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

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

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

Link copied to clipboard
Link copied to clipboard
external fun CPointer<*>.getRawValue(): NativePtr
Link copied to clipboard
external fun <T : ObjCObjectBase> T.initBy(constructorCall: T): T
Link copied to clipboard
external fun <T : CPointed> interpretCPointer(rawValue: NativePtr): CPointer<T>?

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

Link copied to clipboard

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

Link copied to clipboard
inline fun <T : Any> interpretObjCPointer(objcPtr: NativePtr): T
Link copied to clipboard
external fun <T> interpretObjCPointerOrNull(objcPtr: NativePtr): T?
Link copied to clipboard
Link copied to clipboard

Returns interpretation of entity with given pointer.

Link copied to clipboard
operator external fun <R> CPointer<CFunction<() -> R>>.invoke(): R
operator external fun <P1, R> CPointer<CFunction<(P1) -> R>>.invoke(p1: P1): R
operator external fun <P1, P2, R> CPointer<CFunction<(P1, P2) -> R>>.invoke(p1: P1, p2: P2): R
operator external fun <P1, P2, P3, R> CPointer<CFunction<(P1, P2, P3) -> R>>.invoke(    p1: P1,     p2: P2,     p3: P3): R
operator external fun <P1, P2, P3, P4, R> CPointer<CFunction<(P1, P2, P3, P4) -> R>>.invoke(    p1: P1,     p2: P2,     p3: P3,     p4: P4): R
operator external 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 external 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 external 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 external 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 external 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 external 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 external 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 external 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 external 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 external 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 external 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 external 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 external 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 external 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 external 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 external 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 external 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 external 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
Link copied to clipboard
inline fun <T : CPointed> CStructVar.memberAt(offset: Long): T

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

Link copied to clipboard
inline fun <R> memScoped(block: MemScope.() -> R): R

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

Link copied to clipboard
inline external fun <R : Number> Number.narrow(): R
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
external fun objc_lookUpClass(name: NativePtr): NativePtr
Link copied to clipboard
external fun objc_release(ptr: NativePtr)
Link copied to clipboard
external fun objc_retain(ptr: NativePtr): NativePtr
Link copied to clipboard
Link copied to clipboard
external fun Any?.objcPtr(): NativePtr
Link copied to clipboard
Link copied to clipboard
fun <T : Any> T.pin(): Pinned<T>
Link copied to clipboard
Link copied to clipboard
inline operator fun <T : ByteVarOf<*>> CPointer<T>?.plus(index: Int): CPointer<T>?
inline operator fun <T : ByteVarOf<*>> CPointer<T>?.plus(index: Long): CPointer<T>?
inline operator fun <T : CPointerVarOf<*>> CPointer<T>?.plus(index: Int): CPointer<T>?
inline operator fun <T : CPointerVarOf<*>> CPointer<T>?.plus(index: Long): CPointer<T>?
inline operator fun <T : DoubleVarOf<*>> CPointer<T>?.plus(index: Int): CPointer<T>?
inline operator fun <T : DoubleVarOf<*>> CPointer<T>?.plus(index: Long): CPointer<T>?
inline operator fun <T : FloatVarOf<*>> CPointer<T>?.plus(index: Int): CPointer<T>?
inline operator fun <T : FloatVarOf<*>> CPointer<T>?.plus(index: Long): CPointer<T>?
inline operator fun <T : IntVarOf<*>> CPointer<T>?.plus(index: Int): CPointer<T>?
inline operator fun <T : IntVarOf<*>> CPointer<T>?.plus(index: Long): CPointer<T>?
inline operator fun <T : LongVarOf<*>> CPointer<T>?.plus(index: Int): CPointer<T>?
inline operator fun <T : LongVarOf<*>> CPointer<T>?.plus(index: Long): CPointer<T>?
inline operator fun <T : ShortVarOf<*>> CPointer<T>?.plus(index: Int): CPointer<T>?
inline operator fun <T : ShortVarOf<*>> CPointer<T>?.plus(index: Long): CPointer<T>?
inline operator fun <T : UByteVarOf<*>> CPointer<T>?.plus(index: Int): CPointer<T>?
inline operator fun <T : UByteVarOf<*>> CPointer<T>?.plus(index: Long): CPointer<T>?
inline operator fun <T : UIntVarOf<*>> CPointer<T>?.plus(index: Int): CPointer<T>?
inline operator fun <T : UIntVarOf<*>> CPointer<T>?.plus(index: Long): CPointer<T>?
inline operator fun <T : ULongVarOf<*>> CPointer<T>?.plus(index: Int): CPointer<T>?
inline operator fun <T : ULongVarOf<*>> CPointer<T>?.plus(index: Long): CPointer<T>?
inline operator fun <T : UShortVarOf<*>> CPointer<T>?.plus(index: Int): CPointer<T>?
inline operator fun <T : UShortVarOf<*>> CPointer<T>?.plus(index: Long): CPointer<T>?
Link copied to clipboard
external fun readBits(    ptr: NativePtr,     offset: Long,     size: Int,     signed: Boolean): Long
Link copied to clipboard
Link copied to clipboard
inline fun <T : CStructVar> T.readValue(): CValue<T>
fun <T : CVariable> CPointed.readValue(size: Long, align: Int): CValue<T>
Link copied to clipboard
inline fun <T : CVariable> T.readValues(count: Int): CValues<T>
fun <T : CVariable> CPointed.readValues(size: Int, align: Int): CValues<T>
Link copied to clipboard

Changes the interpretation of the pointed data or code.

Link copied to clipboard
inline operator fun <T : Byte> CPointer<ByteVarOf<T>>.set(index: Int, value: T)
inline operator fun <T : Byte> CPointer<ByteVarOf<T>>.set(index: Long, value: T)
inline operator fun <T : CPointer<*>> CPointer<CPointerVarOf<T>>.set(index: Int, value: T?)
inline operator fun <T : CPointer<*>> CPointer<CPointerVarOf<T>>.set(index: Long, value: T?)
inline operator fun <T : Double> CPointer<DoubleVarOf<T>>.set(index: Int, value: T)
inline operator fun <T : Double> CPointer<DoubleVarOf<T>>.set(index: Long, value: T)
inline operator fun <T : Float> CPointer<FloatVarOf<T>>.set(index: Int, value: T)
inline operator fun <T : Float> CPointer<FloatVarOf<T>>.set(index: Long, value: T)
inline operator fun <T : Int> CPointer<IntVarOf<T>>.set(index: Int, value: T)
inline operator fun <T : Int> CPointer<IntVarOf<T>>.set(index: Long, value: T)
inline operator fun <T : Long> CPointer<LongVarOf<T>>.set(index: Int, value: T)
inline operator fun <T : Long> CPointer<LongVarOf<T>>.set(index: Long, value: T)
inline operator fun <T : Short> CPointer<ShortVarOf<T>>.set(index: Int, value: T)
inline operator fun <T : Short> CPointer<ShortVarOf<T>>.set(index: Long, value: T)
inline operator fun <T : UByte> CPointer<UByteVarOf<T>>.set(index: Int, value: T)
inline operator fun <T : UByte> CPointer<UByteVarOf<T>>.set(index: Long, value: T)
inline operator fun <T : UInt> CPointer<UIntVarOf<T>>.set(index: Int, value: T)
inline operator fun <T : UInt> CPointer<UIntVarOf<T>>.set(index: Long, value: T)
inline operator fun <T : ULong> CPointer<ULongVarOf<T>>.set(index: Int, value: T)
inline operator fun <T : ULong> CPointer<ULongVarOf<T>>.set(index: Long, value: T)
inline operator fun <T : UShort> CPointer<UShortVarOf<T>>.set(index: Int, value: T)
inline operator fun <T : UShort> CPointer<UShortVarOf<T>>.set(index: Long, value: T)
Link copied to clipboard
inline external fun <R : Number> Number.signExtend(): R
Link copied to clipboard
inline fun <T : CVariable> sizeOf(): Long
Link copied to clipboard
external fun <R> staticCFunction(function: () -> R): CPointer<CFunction<() -> R>>

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

external 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>>
external 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>>
external 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>>
external 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>>
external 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>>
external 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>>
external 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>>
external 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>>
external 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>>
external 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>>
external fun <P1, R> staticCFunction(function: (P1) -> R): CPointer<CFunction<(P1) -> R>>
external 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>>
external 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>>
external 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>>
external fun <P1, P2, R> staticCFunction(function: (P1, P2) -> R): CPointer<CFunction<(P1, P2) -> R>>
external fun <P1, P2, P3, R> staticCFunction(function: (P1, P2, P3) -> R): CPointer<CFunction<(P1, P2, P3) -> R>>
external fun <P1, P2, P3, P4, R> staticCFunction(function: (P1, P2, P3, P4) -> R): CPointer<CFunction<(P1, P2, P3, P4) -> R>>
external fun <P1, P2, P3, P4, P5, R> staticCFunction(function: (P1, P2, P3, P4, P5) -> R): CPointer<CFunction<(P1, P2, P3, P4, P5) -> R>>
external 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>>
external 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>>
external 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>>
external 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>>
Link copied to clipboard
inline fun Byte.toBoolean(): Boolean
Link copied to clipboard
inline fun Boolean.toByte(): Byte
Link copied to clipboard
Link copied to clipboard

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

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

Link copied to clipboard

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.

Since Kotlin 1.3

fun ByteArray.toKString(    startIndex: Int = 0,     endIndex: Int = this.size,     throwOnInvalidSequence: Boolean = false): 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.

Since Kotlin 1.3
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <T : Any> unwrapKotlinObjectHolder(holder: Any?): T
Link copied to clipboard
inline fun <T : CStructVar, R> CValue<T>.useContents(block: T.() -> R): R

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

Link copied to clipboard
inline fun <T : Any, R> T.usePinned(block: (Pinned<T>) -> R): R
Link copied to clipboard
fun <T : CVariable> CValue<T>.write(location: NativePtr)
Link copied to clipboard
external fun writeBits(    ptr: NativePtr,     offset: Long,     size: Int,     value: Long)
Link copied to clipboard
inline fun <T : CVariable> zeroValue(): CValue<T>
inline fun <T : CVariable> zeroValue(size: Int, align: Int): CValue<T>

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the corresponding CPointed.

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

Link copied to clipboard
val <T : CPointed> T.ptr: CPointer<T>

Returns the pointer to this data or code.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var <T : Byte> ByteVarOf<T>.value: T
var <T : Int> IntVarOf<T>.value: T
var <T : Long> LongVarOf<T>.value: T
var <T : UInt> UIntVarOf<T>.value: T

The value of this variable.

Link copied to clipboard