swig/Examples/test-suite/string_simple.i
Seth R Johnson feeb2516ae "Include what you use" for tests
Many of these tests implicitly required the target language library files to include the headers upstream.
2019-01-06 08:32:34 -05:00

14 lines
266 B
OpenEdge ABL

%module string_simple
%newobject copy_string;
%inline %{
#include <stdlib.h>
#include <string.h>
const char* copy_string(const char* str) {
size_t len = strlen(str);
char* newstring = (char*) malloc(len + 1);
strcpy(newstring, str);
return newstring;
}
%}