rs-basic/members/c-bindings/lib/test.c

18 lines
412 B
C
Raw Normal View History

2023-09-12 17:16:13 +02:00
#include "test.h"
2023-09-12 18:21:59 +02:00
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
2023-09-12 17:16:13 +02:00
int ret19() {
return 19;
}
2023-09-12 18:21:59 +02:00
char* structInfo(MyStruct *st) {
char* buf = malloc(1024*sizeof(char));
/* snprintf(buf, sizeof(buf), "foo: %d\n", st->foo); */
/* snprintf(buf, sizeof(buf), "bar: %c", st->bar); */
sprintf(buf,"Infos about the struct:\nfoo:\t%d\nbar:\t%c\n\ngreetings from C", st->foo, st->bar);
return buf;
}