RosettaCodeData/Task/Use-another-language-to-call-a-function/Kotlin/use-another-language-to-call-a-function-3.kts
2024-10-16 18:07:41 -07:00

25 lines
501 B
Kotlin

#include <stdio.h>
#include <stdlib.h>
#include "libQuery_api.h"
static int Query (char * Data, size_t * Length)
{
return libQuery_symbols() -> kotlin.root.query(Data, Length);
}
int main (int argc, char * argv [])
{
char Buffer [1024];
size_t Size = sizeof (Buffer);
if (0 == Query (Buffer, &Size))
{
printf ("failed to call Query\n");
}
else
{
char * Ptr = Buffer;
while (Size-- > 0) putchar (*Ptr++);
putchar ('\n');
}
}