main.c ``` #include <stdio.h> #include "samp...
# kotlin-native
a
main.c
Copy code
#include <stdio.h>
#include "sample_api.h"


int main() {
	const char *lib_version = kotlin.root.libVersion();
	printf("%s", lib_version);
	kotlin.root.askForMood();
	return 0;
}
sample_api.h (generated from konanc)
Copy code
#ifndef KONAN_SAMPLE_H
#define KONAN_SAMPLE_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
typedef bool            sample_KBoolean;
#else
typedef _Bool           sample_KBoolean;
#endif
typedef char            sample_KByte;
typedef unsigned short  sample_KChar;
typedef short           sample_KShort;
typedef int             sample_KInt;
typedef long long       sample_KLong;
typedef float           sample_KFloat;
typedef double          sample_KDouble;
typedef void*           sample_KNativePtr;
struct sample_KType;
typedef struct sample_KType sample_KType;



typedef struct {
  /* Service functions. */
  void (*DisposeStablePointer)(sample_KNativePtr ptr);
  void (*DisposeString)(const char* string);
  sample_KBoolean (*IsInstance)(sample_KNativePtr ref, const sample_KType* type);

  /* User functions. */
  struct {
    struct {
      const char* (*libVersion)();
      void (*doStuff)();
      void (*askForMood)();
    } root;
  } kotlin;
} sample_ExportedSymbols;
extern sample_ExportedSymbols* sample_symbols(void);
#ifdef __cplusplus
}  /* extern "C" */
#endif
#endif  /* KONAN_SAMPLE_H */