summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pikul.i24
1 files changed, 22 insertions, 2 deletions
diff --git a/pikul.i b/pikul.i
index f6079c0..c045603 100644
--- a/pikul.i
+++ b/pikul.i
@@ -4,8 +4,28 @@
%}
#ifdef SWIGJAVASCRIPT
-%include "carrays.i"
-%array_functions(char *, stringArray);
+%inline %{
+ char *provisions[3];
+ void provisions_set(int i, char *val)
+ {
+ if (provisions[i])
+ free(provisions[i]);
+ provisions[i] = (char *)malloc(strlen(val) + 1);
+ strcpy(provisions[i], val);
+ }
+ char *provisions_get(int i)
+ {
+ return provisions[i];
+ }
+ void provisions_clear()
+ {
+ for (int i = 0; i < 3; i++)
+ if (provisions[i]) {
+ free(provisions[i]);
+ provisions[i] = NULL;
+ }
+ }
+%}
#endif
#ifdef SWIGPERL