~ubuntu-branches/ubuntu/raring/babel/raring-proposed

« back to all changes in this revision

Viewing changes to regression/arrays/runJava/sidl_InvariantViolation_jniStub.c

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV
  • Date: 2008-08-01 07:56:58 UTC
  • mfrom: (3.1.2 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080801075658-9ezcrbh8dcs8lg70
Tags: 1.2.0.dfsg-6
Added libparsifal-dev as dependency to libsidl-dev (closes: #483324).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * File:          sidl_InvariantViolation_jniStub.c
3
 
 * Symbol:        sidl.InvariantViolation-v0.9.1
4
 
 * Symbol Type:   class
5
 
 * Babel Version: 0.10.2
6
 
 * Release:       $Name:  $
7
 
 * Revision:      @(#) $Id: $
8
 
 * Description:   Client-side JNI glue code for sidl.InvariantViolation
9
 
 * 
10
 
 * Copyright (c) 2000-2002, The Regents of the University of California.
11
 
 * Produced at the Lawrence Livermore National Laboratory.
12
 
 * Written by the Components Team <components@llnl.gov>
13
 
 * All rights reserved.
14
 
 * 
15
 
 * This file is part of Babel. For more information, see
16
 
 * http://www.llnl.gov/CASC/components/. Please read the COPYRIGHT file
17
 
 * for Our Notice and the LICENSE file for the GNU Lesser General Public
18
 
 * License.
19
 
 * 
20
 
 * This program is free software; you can redistribute it and/or modify it
21
 
 * under the terms of the GNU Lesser General Public License (as published by
22
 
 * the Free Software Foundation) version 2.1 dated February 1999.
23
 
 * 
24
 
 * This program is distributed in the hope that it will be useful, but
25
 
 * WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
26
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
27
 
 * conditions of the GNU Lesser General Public License for more details.
28
 
 * 
29
 
 * You should have recieved a copy of the GNU Lesser General Public License
30
 
 * along with this program; if not, write to the Free Software Foundation,
31
 
 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32
 
 * 
33
 
 * WARNING: Automatically generated; changes will be lost
34
 
 * 
35
 
 * babel-version = 0.10.2
36
 
 */
37
 
 
38
 
#include "sidl_Java.h"
39
 
#include "sidl_Loader.h"
40
 
#include "sidl_String.h"
41
 
#include "sidl_InvariantViolation_IOR.h"
42
 
#include "babel_config.h"
43
 
 
44
 
/*
45
 
 * Convert between jlong and void* pointers.
46
 
 */
47
 
 
48
 
#if (SIZEOF_VOID_P == 8)
49
 
#define JLONG_TO_POINTER(x) ((void*)(x))
50
 
#define POINTER_TO_JLONG(x) ((jlong)(x))
51
 
#else
52
 
#define JLONG_TO_POINTER(x) ((void*)(int32_t)(x))
53
 
#define POINTER_TO_JLONG(x) ((jlong)(int32_t)(x))
54
 
#endif
55
 
 
56
 
#ifndef NULL
57
 
#define NULL 0
58
 
#endif
59
 
 
60
 
/*
61
 
 * External reference to IOR methods.
62
 
 */
63
 
 
64
 
static const struct sidl_InvariantViolation__external* s_external = NULL;
65
 
 
66
 
/*
67
 
 * Create object instance and return reference.
68
 
 */
69
 
 
70
 
static jlong jni__create_ior(
71
 
  JNIEnv* env,
72
 
  jclass  cls)
73
 
{
74
 
  (void) env;
75
 
  (void) cls;
76
 
  return POINTER_TO_JLONG((*s_external->createObject)());
77
 
}
78
 
 
79
 
/*
80
 
 * Register JNI methods with the Java JVM.
81
 
 */
82
 
 
83
 
void sidl_InvariantViolation__register(JNIEnv* env)
84
 
{
85
 
  JNINativeMethod methods[1];
86
 
  jclass cls;
87
 
 
88
 
  s_external = sidl_InvariantViolation__externals();
89
 
  methods[0].name      = "_create_ior";
90
 
  methods[0].signature = "()J";
91
 
  methods[0].fnPtr     = (void *)jni__create_ior;
92
 
 
93
 
 
94
 
  cls = (*env)->FindClass(env, "sidl/InvariantViolation");
95
 
  if (cls) {
96
 
    (*env)->RegisterNatives(env, cls, methods, 1);
97
 
    (*env)->DeleteLocalRef(env, cls);
98
 
  }
99
 
}