* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
[svn.git] / subversion / bindings / javahl / native / org_tigris_subversion_javahl_Version.cpp
blobd3a738bdd5f048193008f4e381596ad6437c5e1a
1 /**
2 * @copyright
3 * ====================================================================
4 * Copyright (c) 2005 CollabNet. All rights reserved.
6 * This software is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at http://subversion.tigris.org/license-1.html.
9 * If newer versions of this license are posted there, you may use a
10 * newer version instead, at your option.
12 * This software consists of voluntary contributions made by many
13 * individuals. For exact contribution history, see the revision
14 * history and logs, available at http://subversion.tigris.org/.
15 * ====================================================================
16 * @endcopyright
18 * @file org_tigris_subversion_javahl_Version.cpp
19 * @brief Implementation of the native methods in the Java class Version.
22 #include "../include/org_tigris_subversion_javahl_Version.h"
23 #include "JNIStackElement.h"
24 #include "svn_version.h"
26 JNIEXPORT jint JNICALL
27 Java_org_tigris_subversion_javahl_Version_getMajor(JNIEnv *env, jobject jthis)
29 JNIEntry(Version, getMajor);
30 return SVN_VER_MAJOR;
33 JNIEXPORT jint JNICALL
34 Java_org_tigris_subversion_javahl_Version_getMinor(JNIEnv *env, jobject jthis)
36 JNIEntry(Version, getMinor);
37 return SVN_VER_MINOR;
40 JNIEXPORT jint JNICALL
41 Java_org_tigris_subversion_javahl_Version_getPatch(JNIEnv *env, jobject jthis)
43 JNIEntry(Version, getPatch);
44 return SVN_VER_PATCH;
47 JNIEXPORT jstring JNICALL
48 Java_org_tigris_subversion_javahl_Version_getTag(JNIEnv *env, jobject jthis)
50 JNIEntry(Version, getTag);
51 jstring tag = JNIUtil::makeJString(SVN_VER_TAG);
52 if (JNIUtil::isJavaExceptionThrown())
53 return NULL;
55 return tag;
58 JNIEXPORT jstring JNICALL
59 Java_org_tigris_subversion_javahl_Version_getNumberTag(JNIEnv *env,
60 jobject jthis)
62 JNIEntry(Version, getNumberTag);
63 jstring numtag = JNIUtil::makeJString(SVN_VER_NUMTAG);
64 if (JNIUtil::isJavaExceptionThrown())
65 return NULL;
67 return numtag;