Skip to content

Commit

Permalink
chore: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
danil-pavlov committed Mar 4, 2025
1 parent e12b2e5 commit f61cf64
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/topics/native/mapping-function-pointers-from-c.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ In this tutorial, you'll learn how C function pointers are visible from Kotlin a
interop-related usages of Kotlin/Native and [multiplatform](gradle-configure-project.md#targeting-multiple-platforms)
Gradle builds.

In this tutorial, you'll learn how to:
In this tutorial, you'll:

* [How to pass Kotlin function as a C function pointer](#pass-kotlin-function-as-a-c-function-pointer)
* [How to use C function pointers from Kotlin](#use-the-c-function-pointer-from-kotlin)
* [Learn how to pass Kotlin function as a C function pointer](#pass-kotlin-function-as-a-c-function-pointer)
* [Use C function pointers from Kotlin](#use-the-c-function-pointer-from-kotlin)

## Mapping function pointer types from C

Expand Down Expand Up @@ -106,11 +106,11 @@ fun myFun() {
}
```

This call uses the `staticCFunction{}` helper function from Kotlin/Native to wrap a Kotlin lambda function into a C
This call uses the `staticCFunction {}` helper function from Kotlin/Native to wrap a Kotlin lambda function into a C
function pointer. It only allows having unbound and non-capturing lambda functions. For example, it cannot use a local
variable from the function. You can only use globally visible declarations.

It's vital to ensure that the function does not throw any exceptions. Throwing exceptions from a `staticCFunction{}`
It's vital to ensure that the function does not throw any exceptions. Throwing exceptions from a `staticCFunction {}`
will end up in non-deterministic side effects.

## Use the C function pointer from Kotlin
Expand Down

0 comments on commit f61cf64

Please sign in to comment.