Объявления уровня пакета
Экспериментальный API для работы с неуправляемой и внешней памятью, а также для взаимодействия с другими языками, такими как Objective-C и C.
Типы
В Kotlin начиная с версии: 1.3
class Arena(parent: NativeFreeablePlacement = nativeHeap) : ArenaBase
В Kotlin начиная с версии: 1.3
open class ArenaBase(parent: NativeFreeablePlacement = nativeHeap) : AutofreeScope
В Kotlin начиная с версии: 1.3
abstract class AutofreeScope : DeferScope, NativePlacement
В Kotlin начиная с версии: 1.3
annotation class BetaInteropApi
Помечает API взаимодействия с Objective-C и Swift как бета-версию.
В Kotlin начиная с версии: 1.3
typealias BooleanVar = BooleanVarOf<Boolean>
В Kotlin начиная с версии: 1.3
class BooleanVarOf<T : Boolean>(rawPtr: NativePtr) : CPrimitiveVar
В Kotlin начиная с версии: 1.3
typealias CArrayPointer<T> = CPointer<T>
В Kotlin начиная с версии: 1.3
typealias CArrayPointerVar<T> = CPointerVar<T>
В Kotlin начиная с версии: 1.3
abstract class CEnumVar(rawPtr: NativePtr) : CPrimitiveVar
В Kotlin начиная с версии: 1.3
typealias COpaquePointer = CPointer<out CPointed>
Указатель с непрозрачным типом.
В Kotlin начиная с версии: 1.3
typealias COpaquePointerVar = CPointerVarOf<COpaquePointer>
Переменная, содержащая COpaquePointer.
В Kotlin начиная с версии: 1.3
abstract class CPointed(rawPtr: NativePtr) : NativePointed
Данные или код C.
В Kotlin начиная с версии: 1.3
typealias CPointerVar<T> = CPointerVarOf<CPointer<T>>
Переменная данных C, содержащая указатель на T.
В Kotlin начиная с версии: 1.3
class CPointerVarOf<T : CPointer<*>>(rawPtr: NativePtr) : CVariable
В Kotlin начиная с версии: 1.3
sealed class CPrimitiveVar(rawPtr: NativePtr) : CVariable
Переменная с примитивным типом C, расположенная в памяти.
В Kotlin начиная с версии: 1.3
abstract class CStructVar(rawPtr: NativePtr) : CVariable
Переменная со структурным типом C, расположенная в памяти.
В Kotlin начиная с версии: 1.3
abstract class CValuesRef<T : CPointed>
В Kotlin начиная с версии: 1.3
open class DeferScope
В Kotlin начиная с версии: 1.3
typealias DoubleVar = DoubleVarOf<Double>
В Kotlin начиная с версии: 1.3
class DoubleVarOf<T : Double>(rawPtr: NativePtr) : CPrimitiveVar
В Kotlin начиная с версии: 1.3
annotation class ExperimentalForeignApi@Target(allowedTargets = [AnnotationTarget.TYPEALIAS,AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.CLASS ] )
Помечает API, связанный с иностранными языками, как бета-версию.
В Kotlin начиная с версии: 1.3
annotation class ExportObjCClass(val name: String = "")
Делает подкласс Kotlin класса Objective-C доступным для поиска во время выполнения после вызова функции Kotlin main.
В Kotlin начиная с версии: 1.3
annotation class ExternalObjCClass(val protocolGetter: String = "", val binaryName: String = "")
В Kotlin начиная с версии: 1.3
typealias FloatVar = FloatVarOf<Float>
В Kotlin начиная с версии: 1.3
class FloatVarOf<T : Float>(rawPtr: NativePtr) : CPrimitiveVar
В Kotlin начиная с версии: 1.3
class ForeignException : Exception
В Kotlin начиная с версии: 1.3
annotation class InteropStubs
В Kotlin начиная с версии: 1.3
interface NativeFreeablePlacement : NativePlacement
В Kotlin начиная с версии: 1.3
object nativeHeap : NativeFreeablePlacement
В Kotlin начиная с версии: 1.3
interface NativePlacement
В Kotlin начиная с версии: 1.3
open class NativePointed
Сущность, связанная с нативным указателем. Предполагается, что подтипы представляют интерпретации данных или кода, на которые указывает указатель.
В Kotlin начиная с версии: 1.3
annotation class ObjCAction
Делает метод Kotlin в классе Objective-C доступным через диспетчеризацию Objective-C, чтобы его можно было использовать как действие, отправляемое элементом управления в UIKit или AppKit.
В Kotlin начиная с версии: 1.3
typealias ObjCBlockVar<T> = ObjCNotImplementedVar<T>
В Kotlin начиная с версии: 1.3
interface ObjCClass : ObjCObject
В Kotlin начиная с версии: 1.3
interface ObjCClassOf<T : ObjCObject> : ObjCClass
В Kotlin начиная с версии: 1.3
annotation class ObjCConstructor(val initSelector: String, val designated: Boolean)
В Kotlin начиная с версии: 1.3
annotation class ObjCDirect(val symbol: String)
В Kotlin начиная с версии: 1.3
annotation class ObjCFactory(val selector: String, val encoding: String, val isStret: Boolean = false)
В Kotlin начиная с версии: 1.3
annotation class ObjCMethod(val selector: String, val encoding: String, val isStret: Boolean = false)@Target(allowedTargets = [AnnotationTarget.FUNCTION,AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER ] )
В Kotlin начиная с версии: 1.3
class ObjCNotImplementedVar<T>(rawPtr: NativePtr) : CVariable
В Kotlin начиная с версии: 1.3
interface ObjCObject
В Kotlin начиная с версии: 1.3
abstract class ObjCObjectBase : ObjCObject
В Kotlin начиная с версии: 1.3
abstract class ObjCObjectBaseMeta : ObjCObjectBase, ObjCClass
В Kotlin начиная с версии: 1.3
typealias ObjCObjectMeta = ObjCClass
В Kotlin начиная с версии: 1.3
class ObjCObjectVar<T>(rawPtr: NativePtr) : CVariable
В Kotlin начиная с версии: 1.3
annotation class ObjCOutlet
Делает свойство Kotlin в классе Objective-C доступным для установки через диспетчеризацию Objective-C, чтобы использовать его как выходной элемент IB.
В Kotlin начиная с версии: 1.3
interface ObjCProtocol : ObjCObject
В Kotlin начиная с версии: 2.0
annotation class ObjCSignatureOverride
Помечает функции, для которых следует использовать правила Objective-C при определении того, конфликтуют ли две функции.
В Kotlin начиная с версии: 1.3
typealias ObjCStringVarOf<T> = ObjCNotImplementedVar<T>
В Kotlin начиная с версии: 1.3
annotation class ObjCUnavailable
В Kotlin начиная с версии: 1.3
typealias ShortVar = ShortVarOf<Short>
В Kotlin начиная с версии: 1.3
class ShortVarOf<T : Short>(rawPtr: NativePtr) : CPrimitiveVar
В Kotlin начиная с версии: 1.3
typealias UByteVar = UByteVarOf<UByte>
В Kotlin начиная с версии: 1.3
class UByteVarOf<T : UByte>(rawPtr: NativePtr) : CPrimitiveVar
В Kotlin начиная с версии: 1.3
typealias ULongVar = ULongVarOf<ULong>
В Kotlin начиная с версии: 1.3
class ULongVarOf<T : ULong>(rawPtr: NativePtr) : CPrimitiveVar
В Kotlin начиная с версии: 1.3
annotation class UnsafeNumber(val actualPlatformTypes: Array<String>)@Target(allowedTargets = [AnnotationTarget.TYPEALIAS,AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY ] ) @RequiresOptIn(message = "The declaration is using numbers with different bit widths in least two actual platforms. Such types shall not be used in user-defined 'expect fun' signatures",level = RequiresOptIn.Level.ERROR )
Маркер для объявлений, которые зависят от числовых типов разной разрядности как минимум на двух платформах.
В Kotlin начиная с версии: 1.3
typealias UShortVar = UShortVarOf<UShort>
Начиная с Kotlin: 1.3
class UShortVarOf<T : UShort>(rawPtr: NativePtr) : CPrimitiveVar
Начиная с Kotlin: 1.9
typealias Vector128Var = Vector128VarOf<Vector128>
Начиная с Kotlin: 1.9
class Vector128VarOf<T : Vector128>(rawPtr: NativePtr) : CVariable
Свойства
Начиная с Kotlin: 1.3
val nativeNullPtr: NativePtr
Начиная с Kotlin: 1.3
val NativePointed?.rawPtr: NativePtr
Начиная с Kotlin: 1.3
var <T : Boolean> BooleanVarOf<T>.value: T
var <T : Byte> ByteVarOf<T>.value: T
var <T : Double> DoubleVarOf<T>.value: T
var <T : Float> FloatVarOf<T>.value: T
var <T : Int> IntVarOf<T>.value: T
var <T : Long> LongVarOf<T>.value: T
var <T> ObjCNotImplementedVar<T>.value: T
var <T> ObjCObjectVar<T>.value: T
var <T : Short> ShortVarOf<T>.value: T
var <T : UByte> UByteVarOf<T>.value: T
var <T : UInt> UIntVarOf<T>.value: T
var <T : ULong> ULongVarOf<T>.value: T
var <T : UShort> UShortVarOf<T>.value: T
var <P : CPointer<*>> CPointerVarOf<P>.value: P?
Значение этой переменной.
var <T : Vector128> Vector128VarOf<T>.value: T
Функции
Начиная с Kotlin: 1.3
fun Pinned<ByteArray>.addressOf(index: Int): CPointer<ByteVar>
fun Pinned<CharArray>.addressOf(index: Int): CPointer<COpaque>
fun Pinned<DoubleArray>.addressOf(index: Int): CPointer<DoubleVar>
fun Pinned<FloatArray>.addressOf(index: Int): CPointer<FloatVar>
fun Pinned<IntArray>.addressOf(index: Int): CPointer<IntVar>
fun Pinned<LongArray>.addressOf(index: Int): CPointer<LongVar>
fun Pinned<ShortArray>.addressOf(index: Int): CPointer<ShortVar>
fun Pinned<String>.addressOf(index: Int): CPointer<COpaque>
fun Pinned<UByteArray>.addressOf(index: Int): CPointer<UByteVar>
fun Pinned<UIntArray>.addressOf(index: Int): CPointer<UIntVar>
fun Pinned<ULongArray>.addressOf(index: Int): CPointer<ULongVar>
fun Pinned<UShortArray>.addressOf(index: Int): CPointer<UShortVar>
Начиная с Kotlin: 1.3
inline fun <T : CVariable> NativePlacement.alloc(): T
Выделяет память для переменной указанного типа.
fun <T : Boolean> NativePlacement.alloc(value: T): BooleanVarOf<T>
fun <T : Byte> NativePlacement.alloc(value: T): ByteVarOf<T>
fun <T : Double> NativePlacement.alloc(value: T): DoubleVarOf<T>
fun <T : Float> NativePlacement.alloc(value: T): FloatVarOf<T>
fun <T : Int> NativePlacement.alloc(value: T): IntVarOf<T>
fun <T : Long> NativePlacement.alloc(value: T): LongVarOf<T>
fun <T : Short> NativePlacement.alloc(value: T): ShortVarOf<T>
fun <T : UByte> NativePlacement.alloc(value: T): UByteVarOf<T>
fun <T : UInt> NativePlacement.alloc(value: T): UIntVarOf<T>
fun <T : ULong> NativePlacement.alloc(value: T): ULongVarOf<T>
fun <T : UShort> NativePlacement.alloc(value: T): UShortVarOf<T>
Выделяет память для переменной указанного типа значения и инициализирует её заданным значением.
inline fun <T : CVariable> NativePlacement.alloc(initialize: T.() -> Unit): T
Выделяет память для переменной указанного типа и инициализирует её, применяя заданный блок.
Начиная с Kotlin: 1.3
inline fun <T : CVariable> NativePlacement.allocArray(length: Int): CArrayPointer<T>
inline fun <T : CVariable> NativePlacement.allocArray(length: Long): CArrayPointer<T>
Выделяет память для массива C с указанными типом элементов и длиной.
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>
Выделяет память для массива C с указанными типом элементов и длиной и инициализирует его элементы, применяя заданный блок.
Начиная с Kotlin: 1.3
fun NativePlacement.allocArrayOf(elements: ByteArray): CArrayPointer<ByteVar>
fun NativePlacement.allocArrayOf(vararg elements: Float): CArrayPointer<FloatVar>
inline fun <T : CPointer<*>> NativePlacement.allocArrayOf(elements: List<T?>): CArrayPointer<CPointerVarOf<T>>
inline fun <T : CPointer<*>> NativePlacement.allocArrayOf(vararg elements: T?): CArrayPointer<CPointerVarOf<T>>
Выделяет память для массива C с указанными значениями.
Начиная с Kotlin: 1.3
fun <T : CPointed> NativePlacement.allocArrayOfPointersTo(elements: List<T?>): CArrayPointer<CPointerVar<T>>
fun <T : CPointed> NativePlacement.allocArrayOfPointersTo(vararg elements: T?): CArrayPointer<CPointerVar<T>>
Выделяет память для массива C указателей на заданные элементы.
Начиная с Kotlin: 1.3
fun <T : CPointed> NativePlacement.allocPointerTo(): CPointerVar<T>
Начиная с Kotlin: 1.3
inline fun <T : CVariable> CStructVar.arrayMemberAt(offset: Long): CArrayPointer<T>
Начиная с Kotlin: 1.3
inline fun <T : Any> CPointer<*>.asStableRef(): StableRef<T>
Преобразует этот непрозрачный указатель, созданный с помощью StableRef.asCPointer, в StableRef.
Начиная с Kotlin: 1.3
inline fun <R> autoreleasepool(block: () -> R): R
Начиная с Kotlin: 1.3
external fun bitsToDouble(bits: Long): Double
Начиная с Kotlin: 1.3
external fun bitsToFloat(bits: Int): Float
Начиная с Kotlin: 1.3
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
Начиная с Kotlin: 1.3
external fun createKotlinObjectHolder(any: Any?): NativePtr
Начиная с Kotlin: 1.3
fun cValuesOf(vararg elements: Byte): CValues<ByteVar>
Возвращает последовательность неизменяемых значений CValues для передачи в код C.
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 <T : CPointed> cValuesOf(vararg elements: CPointer<T>?): CValues<CPointerVar<T>>
Начиная с Kotlin: 1.3
fun NativeFreeablePlacement.free(pointer: CPointer<*>)
fun NativeFreeablePlacement.free(pointed: NativePointed)
Начиная с Kotlin: 1.3
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
Начиная с Kotlin: 1.3
fun getOriginalKotlinClass(objCClass: ObjCClass): KClass<*>?
Если objCClass — класс, сгенерированный в заголовок Objective-C для класса Kotlin, возвращает KClass исходного класса Kotlin.
fun getOriginalKotlinClass(objCProtocol: ObjCProtocol): KClass<*>?
Если objCProtocol — протокол, сгенерированный в заголовок Objective-C для класса Kotlin, возвращает KClass исходного класса Kotlin.
Начиная с Kotlin: 1.3
external fun NativePointed.getRawPointer(): NativePtr
Начиная с Kotlin: 1.3
external fun CPointer<*>.getRawValue(): NativePtr
Начиная с Kotlin: 1.3
fun interpretNullableOpaquePointed(ptr: NativePtr): NativePointed?
Начиная с Kotlin: 1.3
external fun <T : NativePointed> interpretNullablePointed(ptr: NativePtr): T?
Выполняет приведение типа нативного указателя к заданному типу взаимодействия, включая значения null.
Начиная с Kotlin: 1.3
inline fun <T : Any> interpretObjCPointer(objcPtr: NativePtr): T
Начиная с Kotlin: 1.3
external fun <T> interpretObjCPointerOrNull(objcPtr: NativePtr): T?
Начиная с Kotlin: 1.3
fun interpretOpaquePointed(ptr: NativePtr): NativePointed
Начиная с Kotlin: 1.3
inline fun <T : NativePointed> interpretPointed(ptr: NativePtr): T
Возвращает интерпретацию сущности по заданному указателю.
Начиная с Kotlin: 1.3
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
Начиная с Kotlin: 1.3
inline fun <T : CPointed> CStructVar.memberAt(offset: Long): T
Возвращает член этого CStructVar, расположенный по заданному смещению в байтах.
Начиная с Kotlin: 1.3
external fun objc_autoreleasePoolPop(ptr: NativePtr)
Начиная с Kotlin: 1.3
external fun objc_autoreleasePoolPush(): NativePtr
Начиная с Kotlin: 1.3
external fun objc_release(ptr: NativePtr)
Начиная с Kotlin: 1.3
external fun objc_retain(ptr: NativePtr): NativePtr
Начиная с Kotlin: 1.3
external fun objc_retainAutoreleaseReturnValue(ptr: NativePtr): NativePtr
Начиная с Kotlin: 1.3
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>?
Начиная с Kotlin: 1.3
fun COpaquePointer.readBytes(count: Int): ByteArray
Начиная с Kotlin: 1.3
fun ByteArray.refTo(index: Int): CValuesRef<ByteVar>
fun CharArray.refTo(index: Int): CValuesRef<COpaque>
fun DoubleArray.refTo(index: Int): CValuesRef<DoubleVar>
fun FloatArray.refTo(index: Int): CValuesRef<FloatVar>
fun IntArray.refTo(index: Int): CValuesRef<IntVar>
fun LongArray.refTo(index: Int): CValuesRef<LongVar>
fun ShortArray.refTo(index: Int): CValuesRef<ShortVar>
fun String.refTo(index: Int): CValuesRef<COpaque>
fun UByteArray.refTo(index: Int): CValuesRef<UByteVar>
fun UIntArray.refTo(index: Int): CValuesRef<UIntVar>
fun ULongArray.refTo(index: Int): CValuesRef<ULongVar>
fun UShortArray.refTo(index: Int): CValuesRef<UShortVar>
Начиная с Kotlin: 1.3
fun <T : CPointed> CPointer<*>.reinterpret(): CPointer<T>
inline fun <T : NativePointed> NativePointed.reinterpret(): T
Изменяет интерпретацию данных или кода, на которые указывает указатель.
Начиная с Kotlin: 1.3
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)
Начиная с Kotlin: 1.3
inline external fun <R : Number> Number.signExtend(): R
Начиная с Kotlin: 1.3
external fun <R> staticCFunction(function: () -> R): CPointer<CFunction<() -> R>>
Возвращает указатель на функцию C, которая вызывает заданную статическую функцию Kotlin.
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>>
Начиная с Kotlin: 1.3
fun Array<String>.toCStringArray(autofreeScope: AutofreeScope): CPointer<CPointerVar<ByteVar>>
Преобразует этот массив строк Kotlin в массив строк C, выделяя память для массива и строк C с помощью заданного AutofreeScope.
fun List<String>.toCStringArray(autofreeScope: AutofreeScope): CPointer<CPointerVar<ByteVar>>
Преобразует этот список строк Kotlin в массив строк C, выделяя память для массива и строк C с помощью заданного AutofreeScope.
Начиная с Kotlin: 1.3
fun <T : CPointed> Array<CPointer<T>?>.toCValues(): CValues<CPointerVar<T>>
fun ByteArray.toCValues(): CValues<ByteVar>
fun DoubleArray.toCValues(): CValues<DoubleVar>
fun FloatArray.toCValues(): CValues<FloatVar>
fun IntArray.toCValues(): CValues<IntVar>
fun LongArray.toCValues(): CValues<LongVar>
fun ShortArray.toCValues(): CValues<ShortVar>
fun UByteArray.toCValues(): CValues<UByteVar>
fun UIntArray.toCValues(): CValues<UIntVar>
fun ULongArray.toCValues(): CValues<ULongVar>
fun UShortArray.toCValues(): CValues<UShortVar>
fun <T : CPointed> List<CPointer<T>?>.toCValues(): CValues<CPointerVar<T>>
Начиная с Kotlin: 1.3
fun ByteArray.toKString(): String
Декодирует строку из байтов этого массива в кодировке UTF-8. Байты после первого вхождения байта 0, если он встречается, не декодируются.
fun CPointer<ByteVar>.toKString(): String
fun CPointer<ShortVar>.toKString(): String
fun CPointer<UShortVar>.toKString(): String
fun ByteArray.toKString(startIndex: Int = 0, endIndex: Int = this.size, throwOnInvalidSequence: Boolean = false): String
Декодирует строку из байтов этого массива или его поддиапазона в кодировке UTF-8. Байты после первого вхождения байта 0, если он встречается, не декодируются.
Начиная с Kotlin: 1.3
fun CPointer<ShortVar>.toKStringFromUtf16(): String
fun CPointer<UShortVar>.toKStringFromUtf16(): String
Начиная с Kotlin: 1.3
fun CPointer<IntVar>.toKStringFromUtf32(): String
Начиная с Kotlin: 1.3
fun CPointer<ByteVar>.toKStringFromUtf8(): String
Начиная с Kotlin: 1.3
fun <T : CVariable>typeOf(): CVariable.Type
Начиная с Kotlin: 1.3
inline fun <T : Any> unwrapKotlinObjectHolder(holder: Any?): T
Начиная с Kotlin: 1.3
inline fun <T : CStructVar, R> CValue<T>.useContents(block: T.() -> R): R
Вызывает block, передавая ему временную копию этого значения в качестве получателя.
© 2010–2026 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/core/kotlin-stdlib/kotlinx.cinterop/index.html