Was added for Javascript, but was not being used in full test-suite. Rename from javascript_unicode to simple_string and provide for all languages. Rewrite to use portable C
13 lines
238 B
OpenEdge ABL
13 lines
238 B
OpenEdge ABL
%module string_simple
|
|
|
|
%newobject copy_string;
|
|
|
|
%inline %{
|
|
#include <string.h>
|
|
const char* copy_string(const char* str) {
|
|
size_t len = strlen(str);
|
|
char* newstring = malloc(len + 1);
|
|
strcpy(newstring, str);
|
|
return newstring;
|
|
}
|
|
%}
|