commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1085678 - in /commons/sandbox/runtime/trunk: ./ src/main/java/org/apache/commons/runtime/ src/main/native/ src/main/native/include/acr/ src/main/native/shared/
Date Sat, 26 Mar 2011 10:27:01 GMT
Author: mturk
Date: Sat Mar 26 10:27:00 2011
New Revision: 1085678

URL: http://svn.apache.org/viewvc?rev=1085678&view=rev
Log:
Add old Main and Version

Added:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Main.java   (with
props)
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Version.java  
(with props)
    commons/sandbox/runtime/trunk/src/main/native/shared/version.c   (with props)
Modified:
    commons/sandbox/runtime/trunk/build.xml
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Library.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Unsafe.java
    commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in
    commons/sandbox/runtime/trunk/src/main/native/include/acr/clazz.h
    commons/sandbox/runtime/trunk/src/main/native/include/acr/jnitypes.h
    commons/sandbox/runtime/trunk/src/main/native/include/acr/unsafe.h
    commons/sandbox/runtime/trunk/src/main/native/include/acr/version.h
    commons/sandbox/runtime/trunk/src/main/native/shared/buildmark.c
    commons/sandbox/runtime/trunk/src/main/native/shared/clazz.c
    commons/sandbox/runtime/trunk/src/main/native/shared/debug.c
    commons/sandbox/runtime/trunk/src/main/native/shared/native.c
    commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c

Modified: commons/sandbox/runtime/trunk/build.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/build.xml?rev=1085678&r1=1085677&r2=1085678&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/build.xml (original)
+++ commons/sandbox/runtime/trunk/build.xml Sat Mar 26 10:27:00 2011
@@ -296,7 +296,7 @@ The Apache Software Foundation (http://w
     <!-- ================================================================== -->
     <target name="native-jar" depends="compile"
         description="Generates the Jar file">
-        <copy todir="${build.dest}/java/${build.package.path}/platform/${systemid.os}">
+        <copy todir="${build.dest}/java/${build.package.path}/platform/${systemid.os}/${systemid.cpu}">
             <fileset dir="${runtime.library.path}">
                 <include name="*.${systemid.so}"/>
             </fileset>
@@ -314,7 +314,7 @@ The Apache Software Foundation (http://w
                     <attribute name="Implementation-Vendor-Id" value="org.apache"/>
                     <attribute name="Implementation-Version" value="${version} (build
${DSTAMP} ${TSTAMP})"/>
                 </section>
-                <section name="${build.package.path}/platform/${systemid.os}">
+                <section name="${build.package.path}/platform/${systemid.os}/${systemid.cpu}">
                     <attribute name="Operating-System" value="${systemid.os}"/>
                     <attribute name="Machine" value="${systemid.cpu}"/>
                     <attribute name="Library" value="${runtime.libname}.${systemid.so}"/>

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Library.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Library.java?rev=1085678&r1=1085677&r2=1085678&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Library.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Library.java Sat
Mar 26 10:27:00 2011
@@ -61,10 +61,9 @@ public final class Library
 
     private static String getResName(String name, boolean arch)
     {
-        String res = packageName.replace('.', '/') + "/platform/" +
-                     SystemId.getSysname() + "/";
+        String res = packageName.replace('.', '/') + "/platform/" + SystemId.getSysname()
+ "/";
         if (arch)
-            return res + SystemId.getDataModel() + "/" + name;
+            return res + SystemId.getProcessor() + "/" + name;
         else
             return res + name;
     }
@@ -156,7 +155,7 @@ public final class Library
             // Ignore
         }
         /* Step 3.
-         * Try to load from classpath/platform/os/32|64/libname.
+         * Try to load from classpath/platform/os/cpu/libname.
          */
         String resname;
         InputStream is = null;

Added: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Main.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Main.java?rev=1085678&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Main.java (added)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Main.java Sat Mar
26 10:27:00 2011
@@ -0,0 +1,66 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.runtime;
+
+/**
+ * Main class.
+ *
+ * @since Runtime 1.0
+ *
+ */
+public final class Main
+{
+
+    private Main()
+    {
+        // No instance.
+    }
+
+    /**
+     * Dummy main().
+     * <p>
+     * This class is present only for testing purposes for the moment.
+     * In the future it will be used for launching other JVM instances
+     * from detached JVM.
+     * </>
+     */
+    public static void main(String args[])
+    {
+        try {
+            boolean inited = Loader.load();
+            if (inited) {
+                if (Native.HAS_MAINTAINER_MODE)
+                    Loader.dump();
+                System.out.println("Initialized Apache Commons Runtime : " +
+                    Version.MAJOR   + "."  + Version.MINOR     + "."  +
+                    Version.PATCH);
+                System.out.println("Native build : " +
+                    Version.BUILDMARK + " for " +
+                    Os.getSysname() + "/"  + Os.getDataModel() +  " (" +
+                    SystemId.getProcessor() + ")");
+                System.out.println("Package id   : " +
+                    Properties.VERSION_UUID  + " (" +
+                    Properties.VERSION_BUILT + ")");
+                System.out.println("Location     : " + Loader.getLocation());
+            }
+        } catch (Throwable ex) {
+            ex.printStackTrace();
+        }
+    }
+
+}
+

Propchange: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Main.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Unsafe.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Unsafe.java?rev=1085678&r1=1085677&r2=1085678&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Unsafe.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Unsafe.java Sat
Mar 26 10:27:00 2011
@@ -41,6 +41,11 @@ public final class Unsafe
     }
 
     /**
+     * Invalid Field offset.
+     */
+    public static final int INVALID_FIELD_OFFSET   = -1;
+
+    /**
      * Check if {@code sun.misc.Unsafe} is supported by this JVM.
      */
     public static boolean isSupported()

Added: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Version.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Version.java?rev=1085678&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Version.java (added)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Version.java Sat
Mar 26 10:27:00 2011
@@ -0,0 +1,68 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.runtime;
+
+/** The Version class is used to obtain the native
+ * library part of the Apache Commons Runtime version numbers.
+ * @since Runtime 1.0
+ *
+ */
+public final class Version
+{
+
+    private Version() {
+        // No instance
+    }
+
+    private static native int     get0(int what);
+    private static native boolean get1();
+    private static native String  get2();
+
+    /** Major version
+     * <br />
+     * Major API changes that could cause compatibility problems for older
+     * programs such as structure size changes.  No binary compatibility is
+     * possible across a change in the major version.
+     */
+    public static final int     MAJOR = get0(0);
+
+    /** Minor version
+     * <br />
+     * Minor API changes that do not cause binary compatibility problems.
+     * Minor version might introduce new API.
+     */
+    public static final int     MINOR = get0(1);
+
+    /** Patch level
+     * <br />
+     * Patch level designates only bug fixing release.
+     */
+    public static final int     PATCH = get0(2);
+
+    /**
+     *  This symbol is defined for internal, "development" copies of ACR.
+     *  This symbol will be false for releases.
+     */
+    public static final boolean IS_DEVELOPMENT = get1();
+
+    /**
+     * String representing the build mark of the time at which
+     * the native library was build.
+     */
+    public static final String  BUILDMARK = get2();
+
+}

Propchange: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Version.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in?rev=1085678&r1=1085677&r2=1085678&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in (original)
+++ commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in Sat Mar 26 10:27:00 2011
@@ -98,6 +98,7 @@ LIBSOURCES=\
 	$(TOPDIR)/shared/object.c \
 	$(TOPDIR)/shared/string.c \
 	$(TOPDIR)/shared/unsafe.c \
+	$(TOPDIR)/shared/version.c \
 	$(TOPDIR)/shared/buildmark.c
 
 SHROBJECTS=$(LIBSOURCES:.c=.$(SLO)) $(ASMSOURCES:.S=.$(SLO))

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/clazz.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/clazz.h?rev=1085678&r1=1085677&r2=1085678&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/clazz.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/clazz.h Sat Mar 26 10:27:00
2011
@@ -58,6 +58,12 @@ AcrInitCoreClasses(JNI_STDENV);
 int
 AcrInitOptionalClasses(JNI_STDENV);
 
+int
+AcrLoadRuntimeClasses(JNI_STDENV);
+
+void
+AcrUnloadRuntimeClasses(JNI_STDENV);
+
 /**
  * Get core class instance.
  * @param clazz Class to get. See acr_cclass_e enum

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/jnitypes.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/jnitypes.h?rev=1085678&r1=1085677&r2=1085678&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/jnitypes.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/jnitypes.h Sat Mar 26 10:27:00
2011
@@ -42,6 +42,7 @@ typedef struct JAVA_M_ID {
 
 typedef struct JAVA_F_ID {
     int          o;
+    int          b;
     jfieldID     i;
     const char  *n;
     const char  *s;

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/unsafe.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/unsafe.h?rev=1085678&r1=1085677&r2=1085678&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/unsafe.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/unsafe.h Sat Mar 26 10:27:00
2011
@@ -20,6 +20,8 @@
 #include "acr/jnitypes.h"
 #include "acr/error.h"
 
+#define INVALID_FIELD_OFFSET    (-1)
+
 /**
  * @file unsafe.h
  * @brief

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/version.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/version.h?rev=1085678&r1=1085677&r2=1085678&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/version.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/version.h Sat Mar 26 10:27:00
2011
@@ -63,11 +63,12 @@
  */
 #define ACR_ISDEV_VERSION       1
 
+#if !defined(ACR_STRINGIFY)
 /** Properly quote a value as a string in the C preprocessor */
 #define ACR_STRINGIFY(n)        ACR_STRINGIFY_HELPER(n)
 /** Helper macro for ACR_STRINGIFY */
 #define ACR_STRINGIFY_HELPER(n) #n
-
+#endif
 
 /** The formatted string of APU's version */
 #define ACR_VERSION_STRING \

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/buildmark.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/buildmark.c?rev=1085678&r1=1085677&r2=1085678&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/buildmark.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/buildmark.c Sat Mar 26 10:27:00 2011
@@ -14,7 +14,8 @@
  * limitations under the License.
  */
 
-#include "acr/stdtypes.h"
+#include "acr/jniapi.h"
+#include "acr/string.h"
 
 #if defined(__DATE__) && defined(__TIME__)
 static const char __built[] = __DATE__ " " __TIME__;
@@ -22,3 +23,7 @@ static const char __built[] = __DATE__ "
 static const char __built[] = PACKAGE_CONFIGURED;
 #endif
 
+ACR_JNI_EXPORT(jstring, Version, get2)(JNI_STDARGS)
+{
+    return CSTR_TO_JSTRING(__built);
+}

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/clazz.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/clazz.c?rev=1085678&r1=1085677&r2=1085678&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/clazz.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/clazz.c Sat Mar 26 10:27:00 2011
@@ -238,6 +238,25 @@ AcrInitOptionalClasses(JNI_STDENV)
     return 0;
 }
 
+int
+AcrLoadRuntimeClasses(JNI_STDENV)
+{
+
+#ifdef WIN32
+
+#endif
+    return 0;
+}
+
+void
+AcrUnloadRuntimeClasses(JNI_STDENV)
+{
+
+#ifdef WIN32
+
+#endif
+}
+
 jclass
 AcrGetCoreClass(int clazz)
 {

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/debug.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/debug.c?rev=1085678&r1=1085677&r2=1085678&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/debug.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/debug.c Sat Mar 26 10:27:00 2011
@@ -48,7 +48,7 @@ AcrDebugPrintf(const char *func, const c
         vfprintf(stdout, fmt, ap);
         va_end(ap);
     }
-    fputs(_PR_CRLF, stdout);
+    fputs(ACR_CRLF, stdout);
     fflush(stdout);
 }
 
@@ -60,7 +60,7 @@ AcrDebugAssert(const char *file, const c
             fputc(*(msg++), stdout);
     }
     fprintf(stderr,
-            "Assertion `%s' failed, file %s, line #%d, func %s" _PR_CRLF,
+            "Assertion `%s' failed, file %s, line #%d, func %s" ACR_CRLF,
             msg, basename_c(file), line, func);
     fflush(stderr);
     /* Abort the application */

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/native.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/native.c?rev=1085678&r1=1085677&r2=1085678&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/native.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/native.c Sat Mar 26 10:27:00 2011
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "acr/string.h"
+#include "acr/clazz.h"
 
 ACR_JNI_EXPORT(jboolean, Native, isdbg0)(JNI_STDARGS)
 {
@@ -27,5 +27,7 @@ ACR_JNI_EXPORT(jboolean, Native, isdbg0)
 
 ACR_JNI_EXPORT(jboolean, Native, init0)(JNI_STDARGS)
 {
+    if (AcrLoadRuntimeClasses(_E) != 0)
+        return JNI_FALSE;
     return JNI_TRUE;
 }

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c?rev=1085678&r1=1085677&r2=1085678&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c Sat Mar 26 10:27:00 2011
@@ -29,6 +29,7 @@ J_DECLARE_CLAZZ = {
 J_DECLARE_F_ID(0000) = {
     0,
     0,
+    0,
     "theUnsafe",
     "Lsun/misc/Unsafe;"
 };
@@ -54,7 +55,7 @@ J_DECLARE_M_ID(0002) = {
 J_DECLARE_M_ID(0003) = {
     0,
     "staticFieldBase",
-    "(Ljava/lang/reflect/Field;)J"
+    "(Ljava/lang/reflect/Field;)Ljava/lang/Object;"
 };
 
 J_DECLARE_M_ID(0004) = {
@@ -103,13 +104,13 @@ AcrUnsafeObjectFieldOffset(JNI_STDARGS)
 {
     jlong fo;
     if (_get_unsafe(_E) == 0) {
-        return 0;
+        return INVALID_FIELD_OFFSET;
     }
     fo = CALL_METHOD1(Long, 0002, _unsafe_instance, _O);
     if (fo > 0 && fo < INT_MAX)
         return (jint)fo;
     else
-        return 0;
+        return INVALID_FIELD_OFFSET;
 }
 
 jint
@@ -117,13 +118,13 @@ AcrUnsafeStaticFieldBase(JNI_STDARGS)
 {
     jlong fo;
     if (_get_unsafe(_E) == 0) {
-        return 0;
+        return INVALID_FIELD_OFFSET;
     }
     fo = CALL_METHOD1(Long, 0003, _unsafe_instance, _O);
     if (fo > 0 && fo < INT_MAX)
         return (jint)fo;
     else
-        return 0;
+        return INVALID_FIELD_OFFSET;
 }
 
 jint
@@ -131,23 +132,23 @@ AcrUnsafeStaticFieldOffset(JNI_STDARGS)
 {
     jlong fo;
     if (_get_unsafe(_E) == 0) {
-        return 0;
+        return INVALID_FIELD_OFFSET;
     }
     fo = CALL_METHOD1(Long, 0004, _unsafe_instance, _O);
     if (fo > 0 && fo < INT_MAX)
         return (jint)fo;
     else
-        return 0;
+        return INVALID_FIELD_OFFSET;
 }
 
 jint
 AcrUnsafeObjectFieldIdOffset(JNI_STDENV, jclass cls, jfieldID fid)
 {
     jobject fld;
-    int     off = 0;
+    int     off = INVALID_FIELD_OFFSET;
 
     if (!CLAZZ_LOADED)
-        return 0;
+        return off;
     fld = (*_E)->ToReflectedField(_E, cls, fid, JNI_FALSE);
     if (fld != 0) {
         off = AcrUnsafeObjectFieldOffset(_E, fld);
@@ -160,10 +161,10 @@ jint
 AcrUnsafeStaticFieldIdOffset(JNI_STDENV, jclass cls, jfieldID fid)
 {
     jobject fld;
-    int     off = 0;
+    int     off = INVALID_FIELD_OFFSET;
 
     if (!CLAZZ_LOADED)
-        return 0;
+        return off;
     fld = (*_E)->ToReflectedField(_E, cls, fid, JNI_TRUE);
     if (fld != 0) {
         off = AcrUnsafeStaticFieldOffset(_E, fld);

Added: commons/sandbox/runtime/trunk/src/main/native/shared/version.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/version.c?rev=1085678&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/version.c (added)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/version.c Sat Mar 26 10:27:00 2011
@@ -0,0 +1,49 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "acr/jniapi.h"
+#include "acr/string.h"
+#include "acr/version.h"
+
+ACR_JNI_EXPORT(jint, Version, get0)(JNI_STDARGS, jint what)
+{
+    UNREFERENCED_STDARGS;
+    switch (what) {
+        case 0:
+            return ACR_MAJOR_VERSION;
+        break;
+        case 1:
+            return ACR_MINOR_VERSION;
+        break;
+        case 2:
+            return ACR_PATCH_VERSION;
+        break;
+        default:
+        break;
+    }
+    return -1;
+}
+
+ACR_JNI_EXPORT(jboolean, Version, get1)(JNI_STDARGS)
+{
+    UNREFERENCED_STDARGS;
+#if ACR_ISDEV_VERSION
+    return JNI_TRUE;
+#else
+    return JNI_FALSE;
+#endif
+}
+

Propchange: commons/sandbox/runtime/trunk/src/main/native/shared/version.c
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message