source: valtobtest/subversion-1.6.2/subversion/bindings/javahl/native/org_tigris_subversion_javahl_Version.cpp @ 3

Last change on this file since 3 was 3, checked in by valtob, 15 years ago

subversion source 1.6.2 as test

File size: 2.0 KB
Line 
1/**
2 * @copyright
3 * ====================================================================
4 * Copyright (c) 2005 CollabNet.  All rights reserved.
5 *
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.
11 *
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
17 *
18 * @file org_tigris_subversion_javahl_Version.cpp
19 * @brief Implementation of the native methods in the Java class Version.
20 */
21
22#include "../include/org_tigris_subversion_javahl_Version.h"
23#include "JNIStackElement.h"
24#include "svn_version.h"
25
26JNIEXPORT jint JNICALL
27Java_org_tigris_subversion_javahl_Version_getMajor(JNIEnv *env, jobject jthis)
28{
29  JNIEntry(Version, getMajor);
30  return SVN_VER_MAJOR;
31}
32
33JNIEXPORT jint JNICALL
34Java_org_tigris_subversion_javahl_Version_getMinor(JNIEnv *env, jobject jthis)
35{
36  JNIEntry(Version, getMinor);
37  return SVN_VER_MINOR;
38}
39
40JNIEXPORT jint JNICALL
41Java_org_tigris_subversion_javahl_Version_getPatch(JNIEnv *env, jobject jthis)
42{
43  JNIEntry(Version, getPatch);
44  return SVN_VER_PATCH;
45}
46
47JNIEXPORT jstring JNICALL
48Java_org_tigris_subversion_javahl_Version_getTag(JNIEnv *env, jobject jthis)
49{
50  JNIEntry(Version, getTag);
51  jstring tag = JNIUtil::makeJString(SVN_VER_TAG);
52  if (JNIUtil::isJavaExceptionThrown())
53    return NULL;
54
55  return tag;
56}
57
58JNIEXPORT jstring JNICALL
59Java_org_tigris_subversion_javahl_Version_getNumberTag(JNIEnv *env,
60                                                       jobject jthis)
61{
62  JNIEntry(Version, getNumberTag);
63  jstring numtag = JNIUtil::makeJString(SVN_VER_NUMTAG);
64  if (JNIUtil::isJavaExceptionThrown())
65    return NULL;
66
67  return numtag;
68}
Note: See TracBrowser for help on using the repository browser.