Map sci_types to java thanks to SWIG 04/904/3
Sylvestre Ledru [Tue, 8 Jun 2010 12:31:31 +0000 (14:31 +0200)]
Change-Id: I2be1f905312964c204ab48f67f0f383277ce1430

scilab/modules/types/Makefile.am
scilab/modules/types/Makefile.in
scilab/modules/types/src/java/org/scilab/modules/types/scilabTypes/ScilabTypeEnum.java [new file with mode: 0644]
scilab/modules/types/src/jni/sci_types.i [new file with mode: 0644]

index 79dfa3f..c603c37 100644 (file)
@@ -71,7 +71,9 @@ INCLUDE_FLAGS = $(libscitypes_la_CFLAGS)
 
 
 #### SWIG Declaration ####
-SWIG_WRAPPERS = 
+SWIG_WRAPPERS = src/jni/sci_types.i
+
+
 
 if SWIG
 BUILT_SOURCES=swig
index 70304fa..0a48824 100644 (file)
@@ -494,7 +494,7 @@ CHECK_SRC = $(TYPES_C_SOURCES) $(GATEWAY_C_SOURCES)
 INCLUDE_FLAGS = $(libscitypes_la_CFLAGS)
 
 #### SWIG Declaration ####
-SWIG_WRAPPERS = 
+SWIG_WRAPPERS = src/jni/sci_types.i
 libscitypes_la_LIBADD = $(top_builddir)/modules/core/libscicore.la \
 $(top_builddir)/libs/MALLOC/libscimalloc.la \
 $(top_builddir)/modules/output_stream/libscioutput_stream.la
diff --git a/scilab/modules/types/src/java/org/scilab/modules/types/scilabTypes/ScilabTypeEnum.java b/scilab/modules/types/src/java/org/scilab/modules/types/scilabTypes/ScilabTypeEnum.java
new file mode 100644 (file)
index 0000000..cda06ea
--- /dev/null
@@ -0,0 +1,68 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.40
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+package org.scilab.modules.types;
+
+public enum ScilabTypeEnum {
+  sci_matrix(1),
+  sci_poly(2),
+  sci_boolean(4),
+  sci_sparse(5),
+  sci_boolean_sparse(6),
+  sci_matlab_sparse(7),
+  sci_ints(8),
+  sci_handles(9),
+  sci_strings(10),
+  sci_u_function(11),
+  sci_c_function(13),
+  sci_lib(14),
+  sci_list(15),
+  sci_tlist(16),
+  sci_mlist(17),
+  sci_pointer(128),
+  sci_implicit_poly(129),
+  sci_intrinsic_function(130);
+
+  public final int swigValue() {
+    return swigValue;
+  }
+
+  public static ScilabTypeEnum swigToEnum(int swigValue) {
+    ScilabTypeEnum[] swigValues = ScilabTypeEnum.class.getEnumConstants();
+    if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
+      return swigValues[swigValue];
+    for (ScilabTypeEnum swigEnum : swigValues)
+      if (swigEnum.swigValue == swigValue)
+        return swigEnum;
+    throw new IllegalArgumentException("No enum " + ScilabTypeEnum.class + " with value " + swigValue);
+  }
+
+  @SuppressWarnings("unused")
+  private ScilabTypeEnum() {
+    this.swigValue = SwigNext.next++;
+  }
+
+  @SuppressWarnings("unused")
+  private ScilabTypeEnum(int swigValue) {
+    this.swigValue = swigValue;
+    SwigNext.next = swigValue+1;
+  }
+
+  @SuppressWarnings("unused")
+  private ScilabTypeEnum(ScilabTypeEnum swigEnum) {
+    this.swigValue = swigEnum.swigValue;
+    SwigNext.next = this.swigValue+1;
+  }
+
+  private final int swigValue;
+
+  private static class SwigNext {
+    private static int next = 0;
+  }
+}
+
diff --git a/scilab/modules/types/src/jni/sci_types.i b/scilab/modules/types/src/jni/sci_types.i
new file mode 100644 (file)
index 0000000..ba2d223
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+/* Call_Scilab.i */
+/**
+ * Windows: swig -java -package org.scilab.modules.types -outdir ../java/org/scilab/modules/types/scilabTypes/ sci_types.i 
+ * Other: Use the option --enable-build-swig to the configure
+*/
+
+%include "enums.swg"
+%javaconst(1);
+// Rename the enum datatype
+%rename(ScilabTypeEnum) sci_types;
+
+%module types
+%{
+#include "../../../core/includes/sci_types.h"
+%}
+%include "../../../core/includes/sci_types.h"