RosettaCodeData/Task/Call-a-foreign-language-function/Pluto/call-a-foreign-language-function-1.pluto
2025-08-11 18:05:26 -07:00

18 lines
295 B
Text

/* mylib.c */
// gcc -c -fpic mylib.c
// gcc -shared -o mylib.so mylib.o
#include <string.h>
#include <stdlib.h>
static void *strptr = NULL;
extern char *my_strdup(const char *src) {
strptr = (void *)strdup(src);
return (char *)strptr;
}
extern void my_free() {
free(strptr);
}