Possible to manipulate Kotlin collections from `C`?

I’m trying to build a Python extension on Kotlin (native) but do not seem to get how to pass data stored in Python dictionary to Kotlin code.

Kotlin generates a C header with structures correspondent to classes defined in my project but with respect to standard libs it only generates kind of handle like:

typedef struct {
  <my lib>_KNativePtr pinned;
} <my lib>_kref_kotlin_collections_Map;

Which is not sufficient for instantiation and manipulation of Kotlin HashMap.

Are there headers for std libs available somewhere else or this is not supposed to work this way?

If you want to get access to Kotlin collections from the C side, you got to provide factory methods, consuming Kotlin primitive types as input. This also applies to other parts of the collection’s API, not only for constructors.

1 Like

Oh, this would work, thanx!