RosettaCodeData/Task/Call-a-foreign-language-function/PicoLisp/call-a-foreign-language-function-2.l
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

17 lines
309 B
Common Lisp

(load "@lib/native.l")
(gcc "str" NIL
(duptest (Str) duptest 'S Str) )
#include <stdlib.h>
#include <string.h>
char *duptest(char *str) {
static char *s;
free(s); // We simply dispose the result of the last call
return s = strdup(str);
}
/**/
(println 'Duplicate (duptest "Hello world!"))