@file:OptIn(ExperimentalNativeApi::class, ExperimentalForeignApi::class)

package com.example.kotlin_sample

import kotlinx.cinterop.ExperimentalForeignApi
import kotlin.experimental.ExperimentalNativeApi
import kotlinx.cinterop.toKString
import kotlinx.cinterop.CPointer
import kotlinx.cinterop.UByteVar
import sample.sample_add
import sample.sample_version
import sample.get_sample_image
import sample.get_sample_image_size

@CName("getStaticLibSum")
fun getStaticLibSum(a: Int, b: Int): Int = sample_add(a, b)

@CName("getStaticLibVersion")
fun getStaticLibVersion(): String = sample_version()?.toKString() ?: "unknown"

@CName("getStaticLibImage")
fun getStaticLibImage(): CPointer<UByteVar>? = get_sample_image()

@CName("getStaticLibImageSize")
fun getStaticLibImageSize(): Int = get_sample_image_size()
