feat: add ffi c

This commit is contained in:
2020-12-27 15:09:31 +08:00
parent 784be79abf
commit f0958ac291
5 changed files with 57 additions and 0 deletions

15
__ffi/c2/cfunctions.c Normal file
View File

@@ -0,0 +1,15 @@
#include "cfunctions.h"
#include "stdio.h"
#include <stdlib.h>
void doit(int nr) {
printf("Do something. nr: %d\n", nr);
printf("Going to call exit\n");
exit(1);
printf("After calling exit\n");
}
void print_string(char* s) {
printf("print_string. s: %s\n", s);
}