Hi everyone. Who can help me? I cannot understand ...
# kotlin-native
z
Hi everyone. Who can help me? I cannot understand how I can create and use object and C language after kotlin native generate library for native platform. I have a struct:
Copy code
typedef struct {
  libpst_KNativePtr pinned;
} libpst_kref_kotlin_Array;
And I have a function which get this object as parameter:
Copy code
libpst_KInt (*hash)(libpst_kref_com_tullynore_base_util_HashUtil thiz, libpst_kref_kotlin_Array values);
a
To work with objects that come from Kotlin, you should provide additional functions. In this particular case, you got to write some factory function, that will create an instance of your
Array
object. Then you’ll see it in the library, and use from the C code.
z
Are there already ready libraries for this? Is it obvious that kotlin types are needed for such libraries?
a
Currently, I don’t know about some pre-made libs to provide such functionality. But if you feel some inspiration to develop one - we will appreciate that.
z
thanks