Package kotlinx.cinterop
Types
ArenaBase
open
class
ArenaBase
:
AutofreeScope
AutofreeScope
abstract
class
AutofreeScope
:
DeferScope
,
NativePlacement
BooleanVar
typealias
BooleanVar
=
BooleanVarOf
<
Boolean
>
BooleanVarOf
class
BooleanVarOf
<
T
:
Boolean
>
:
CPrimitiveVar
ByteVarOf
class
ByteVarOf
<
T
:
Byte
>
:
CPrimitiveVar
CArrayPointer
typealias
CArrayPointer
<
T
>
=
CPointer
<
T
>
CArrayPointerVar
typealias
CArrayPointerVar
<
T
>
=
CPointerVar
<
T
>
CEnum
interface
CEnum
CEnumVar
abstract
class
CEnumVar
:
CPrimitiveVar
COpaquePointerVar
The variable containing a COpaquePointer .
typealias
COpaquePointerVar
=
CPointerVarOf
<
COpaquePointer
>
CPlusPlusClass
interface
CPlusPlusClass
CPointed
C data or code.
abstract
class
CPointed
:
NativePointed
CPointer
C pointer.
class
CPointer
<
T
:
CPointed
>
:
CValuesRef
<
T
>
CPointerVar
The C data variable containing the pointer to
T
.
typealias
CPointerVar
<
T
>
=
CPointerVarOf
<
CPointer
<
T
>
>
CPrimitiveVar
The C primitive-typed variable located in memory.
sealed
class
CPrimitiveVar
:
CVariable
CStructVar
The C struct-typed variable located in memory.
abstract
class
CStructVar
:
CVariable
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
>
DeferScope
open
class
DeferScope
DoubleVar
typealias
DoubleVar
=
DoubleVarOf
<
Double
>
DoubleVarOf
class
DoubleVarOf
<
T
:
Double
>
:
CPrimitiveVar
FloatVar
typealias
FloatVar
=
FloatVarOf
<
Float
>
FloatVarOf
class
FloatVarOf
<
T
:
Float
>
:
CPrimitiveVar
ForeignException
class
ForeignException
:
Exception
IntVarOf
class
IntVarOf
<
T
:
Int
>
:
CPrimitiveVar
LongVarOf
class
LongVarOf
<
T
:
Long
>
:
CPrimitiveVar
ManagedType
abstract
class
ManagedType
<
T
:
CStructVar
>
NativeFreeablePlacement
interface
NativeFreeablePlacement
:
NativePlacement
nativeHeap
object
nativeHeap
:
NativeFreeablePlacement
NativePlacement
interface
NativePlacement
NativePointed
The entity which has an associated native pointer. Subtypes are supposed to represent interpretations of the pointed data or code.
open
class
NativePointed
NativePtr
typealias
NativePtr
=
NativePtr
ObjCBlockVar
typealias
ObjCBlockVar
<
T
>
=
ObjCNotImplementedVar
<
T
>
ObjCClass
interface
ObjCClass
:
ObjCObject
ObjCClassOf
interface
ObjCClassOf
<
T
:
ObjCObject
>
:
ObjCClass
ObjCNotImplementedVar
class
ObjCNotImplementedVar
<
T
>
:
CVariable
ObjCObject
interface
ObjCObject
ObjCObjectBase
abstract
class
ObjCObjectBase
:
ObjCObject
ObjCObjectBaseMeta
abstract
class
ObjCObjectBaseMeta
:
ObjCObjectBase
,
ObjCObjectMeta
ObjCObjectMeta
typealias
ObjCObjectMeta
=
ObjCClass
ObjCObjectVar
class
ObjCObjectVar
<
T
>
:
CVariable
ObjCProtocol
interface
ObjCProtocol
:
ObjCObject
ObjCStringVarOf
typealias
ObjCStringVarOf
<
T
>
=
ObjCNotImplementedVar
<
T
>
Pinned
data
class
Pinned
<
out
T
:
Any
>
ShortVar
typealias
ShortVar
=
ShortVarOf
<
Short
>
ShortVarOf
class
ShortVarOf
<
T
:
Short
>
:
CPrimitiveVar
SkiaRefCnt
interface
SkiaRefCnt
StableRef
class
StableRef
<
out
T
:
Any
>
UByteVar
typealias
UByteVar
=
UByteVarOf
<
UByte
>
UByteVarOf
class
UByteVarOf
<
T
:
UByte
>
:
CPrimitiveVar
UIntVarOf
class
UIntVarOf
<
T
:
UInt
>
:
CPrimitiveVar
ULongVar
typealias
ULongVar
=
ULongVarOf
<
ULong
>
ULongVarOf
class
ULongVarOf
<
T
:
ULong
>
:
CPrimitiveVar
UShortVar
typealias
UShortVar
=
UShortVarOf
<
UShort
>
UShortVarOf
class
UShortVarOf
<
T
:
UShort
>
:
CPrimitiveVar
Vector128
class
Vector128
Vector128Var
typealias
Vector128Var
=
Vector128VarOf
<
Vector128
>
Annotations
BetaInteropApi
Marks Objective-C and Swift interoperability API as Beta.
annotation
class
BetaInteropApi
ExperimentalForeignApi
Marks foreign-language-related API as experimental.
annotation
class
ExperimentalForeignApi
ExportObjCClass
Makes Kotlin subclass of Objective-C class visible for runtime lookup
after Kotlin
main
function gets invoked.
annotation
class
ExportObjCClass
ExternalObjCClass
annotation
class
ExternalObjCClass
InteropStubs
annotation
class
InteropStubs
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
ObjCConstructor
annotation
class
ObjCConstructor
ObjCDirect
annotation
class
ObjCDirect
ObjCFactory
annotation
class
ObjCFactory
ObjCMethod
annotation
class
ObjCMethod
ObjCOutlet
Makes Kotlin property in Objective-C class settable through Objective-C dispatch to be used as IB outlet.
annotation
class
ObjCOutlet
UnsafeNumber
Marker for declarations that depend on numeric types of different bit width on at least two platforms.
annotation
class
UnsafeNumber
Properties
nativeNullPtr
val
nativeNullPtr
:
NativePtr
pointed
The code or data pointed by the value of this variable.
var
<
T
:
CPointed
,
P
:
CPointer
<
T
>
>
CPointerVarOf
<
P
>
.
pointed
:
T
?
ptr
val
<
T
:
CStructVar
>
ManagedType
<
T
>
.
ptr
:
CPointer
<
T
>
rawPtr
val
NativePointed
?
.
rawPtr
:
NativePtr
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
:
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
?
Functions
addressOf
fun
Pinned
<
ShortArray
>
.
addressOf
(
index
:
Int
)
:
CPointer
<
ShortVar
>
fun
Pinned
<
UByteArray
>
.
addressOf
(
index
:
Int
)
:
CPointer
<
UByteVar
>
fun
Pinned
<
UShortArray
>
.
addressOf
(
index
:
Int
)
:
CPointer
<
UShortVar
>
fun
Pinned
<
ULongArray
>
.
addressOf
(
index
:
Int
)
:
CPointer
<
ULongVar
>
fun
Pinned
<
FloatArray
>
.
addressOf
(
index
:
Int
)
:
CPointer
<
FloatVar
>
fun
Pinned
<
DoubleArray
>
.
addressOf
(
index
:
Int
)
:
CPointer
<
DoubleVar
>
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
>
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
>
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
>
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
>
>
allocPointerTo
fun
<
T
:
CPointed
>
NativePlacement
.
allocPointerTo
(
)
:
CPointerVar
<
T
>
arrayMemberAt
fun
<
T
:
CVariable
>
CStructVar
.
arrayMemberAt
(
offset
:
Long
)
:
CArrayPointer
<
T
>
asStableRef
Converts to StableRef this opaque pointer produced by StableRef.asCPointer .
autoreleasepool
fun
<
R
>
autoreleasepool
(
block
:
(
)
->
R
)
:
R
bitsToDouble
fun
bitsToDouble
(
bits
:
Long
)
:
Double
bitsToFloat
fun
bitsToFloat
(
bits
:
Int
)
:
Float
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
copy
fun
<
T
:
CStructVar
>
CValue
<
T
>
.
copy
(
modify
:
T
.
(
)
->
Unit
)
:
CValue
<
T
>
createKotlinObjectHolder
fun
createKotlinObjectHolder
(
any
:
Any
?
)
:
NativePtr
CreateKStringFromNSString
fun
CreateKStringFromNSString
(
ptr
:
NativePtr
)
:
String
?
CreateNSStringFromKString
fun
CreateNSStringFromKString
(
str
:
String
?
)
:
NativePtr
cValue
fun
<
T
:
CStructVar
>
cValue
(
initialize
:
T
.
(
)
->
Unit
)
:
CValue
<
T
>
cValuesOf
Returns sequence of immutable values CValues to pass them to C code.
fun
<
T
:
CPointed
>
cValuesOf
(
vararg
elements
:
CPointer
<
T
>
?
)
:
CValues
<
CPointerVar
<
T
>
>
free
fun
NativeFreeablePlacement
.
free
(
pointer
:
CPointer
<
*
>
)
fun
NativeFreeablePlacement
.
free
(
pointed
:
NativePointed
)
get
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
:
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
:
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
:
CPointer
<
*
>
>
CPointer
<
CPointerVarOf
<
T
>
>
.
get
(
index
:
Int
)
:
T
?
operator
fun
<
T
:
CPointer
<
*
>
>
CPointer
<
CPointerVarOf
<
T
>
>
.
get
(
index
:
Long
)
:
T
?
getOriginalKotlinClass
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.
fun
getOriginalKotlinClass
(
objCProtocol
:
ObjCProtocol
)
:
KClass
<
*
>
?
getRawPointer
fun
NativePointed
.
getRawPointer
(
)
:
NativePtr
initBy
fun
<
T
:
ObjCObjectBase
>
T
.
initBy
(
constructorCall
:
T
)
:
T
interpretNullableOpaquePointed
fun
interpretNullableOpaquePointed
(
ptr
:
NativePtr
)
:
NativePointed
?
interpretNullablePointed
Performs type cast of the native pointer to given interop type, including null values.
fun
<
T
:
NativePointed
>
interpretNullablePointed
(
ptr
:
NativePtr
)
:
T
?
interpretObjCPointer
fun
<
T
:
Any
>
interpretObjCPointer
(
objcPtr
:
NativePtr
)
:
T
interpretObjCPointerOrNull
fun
<
T
>
interpretObjCPointerOrNull
(
objcPtr
:
NativePtr
)
:
T
?
interpretOpaquePointed
fun
interpretOpaquePointed
(
ptr
:
NativePtr
)
:
NativePointed
interpretPointed
Returns interpretation of entity with given pointer.
fun
<
T
:
NativePointed
>
interpretPointed
(
ptr
:
NativePtr
)
:
T
invoke
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
memberAt
Returns the member of this CStructVar which is located by given offset in bytes.
fun
<
T
:
CPointed
>
CStructVar
.
memberAt
(
offset
:
Long
)
:
T
objc_autoreleasePoolPop
fun
objc_autoreleasePoolPop
(
ptr
:
NativePtr
)
objc_autoreleasePoolPush
fun
objc_autoreleasePoolPush
(
)
:
NativePtr
objc_release
fun
objc_release
(
ptr
:
NativePtr
)
placeTo
fun
<
T
:
CVariable
>
CValues
<
T
>
.
placeTo
(
scope
:
AutofreeScope
)
:
CPointer
<
T
>
readBytes
fun
COpaquePointer
.
readBytes
(
count
:
Int
)
:
ByteArray
readValue
fun
<
T
:
CStructVar
>
T
.
readValue
(
)
:
CValue
<
T
>
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
>
reinterpret
Changes the interpretation of the pointed data or code.
fun
<
T
:
NativePointed
>
NativePointed
.
reinterpret
(
)
:
T
set
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
:
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
:
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
?
)
staticCFunction
Returns a pointer to C function which calls given Kotlin static function.
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
>
>
toBoolean
fun
Byte
.
toBoolean
(
)
:
Boolean
toByte
fun
Boolean
.
toByte
(
)
:
Byte
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
>
>
toCValues
fun
ShortArray
.
toCValues
(
)
:
CValues
<
ShortVar
>
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
ULongArray
.
toCValues
(
)
:
CValues
<
ULongVar
>
toKString
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
unwrapKotlinObjectHolder
fun
<
T
:
Any
>
unwrapKotlinObjectHolder
(
holder
:
Any
?
)
:
T
useContents
Calls the block with temporary copy of this value as receiver.
fun
<
T
:
CStructVar
,
R
>
CValue
<
T
>
.
useContents
(
block
:
T
.
(
)
->
R
)
:
R