Kotlin Native declarations for stdiio.h

I’m using cinterop to generate interoperability stubs for C libraries. When I generate a interop for a library like libcurl, a libcurl.kt file is created with stubs for functions defined in curl.h. Now I can add this file to my project and get autocompletion for curl functions.
But when I do the same for stdio.h, the generated stdio.kt file contains no stubs. I can use the functions in my program. But now I don’t get any completion in IDEA. So is there any way to generate declarations from C header files like stdio.h, time.h, etc. Much like ts2kt generates kotlin declarations from typescript d.ts files.

I’m using OS X and kotlin native 0.3.4

Because stdio.h is available as part of platform libraries, so you could just use all declarations from there using
import platform.posix.*
in your program. No need to generate additional stubs.

1 Like