Many of these tests implicitly required the target language library files to include the headers upstream.
14 lines
266 B
OpenEdge ABL
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;
|
|
}
|
|
%}
|