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

« back to all changes in this revision

Viewing changes to regression/sort/runJava/sidl_io_Serializer_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_io_Serializer_jniStub.c
3
 
 * Symbol:        sidl.io.Serializer-v0.9.1
4
 
 * Symbol Type:   interface
5
 
 * Babel Version: 0.10.2
6
 
 * Release:       $Name:  $
7
 
 * Revision:      @(#) $Id: $
8
 
 * Description:   Client-side JNI glue code for sidl.io.Serializer
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_io_Serializer_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
 
 * Function to extract IOR reference from the Java object.
62
 
 */
63
 
 
64
 
static struct sidl_io_Serializer__object* _get_ior(
65
 
  JNIEnv* env,
66
 
  jobject obj)
67
 
{
68
 
  void* ptr = NULL;
69
 
  static jmethodID mid = (jmethodID) NULL;
70
 
 
71
 
  if (mid == (jmethodID) NULL) {
72
 
    jclass cls = (*env)->GetObjectClass(env, obj);
73
 
    mid = (*env)->GetMethodID(env, cls, "_get_ior", "()J");
74
 
    (*env)->DeleteLocalRef(env, cls);
75
 
  }
76
 
 
77
 
  ptr = JLONG_TO_POINTER((*env)->CallLongMethod(env, obj, mid));
78
 
  return (struct sidl_io_Serializer__object*) ptr;
79
 
}
80
 
 
81
 
/*
82
 
 * <p>
83
 
 * Add one to the intrinsic reference count in the underlying object.
84
 
 * Object in <code>sidl</code> have an intrinsic reference count.
85
 
 * Objects continue to exist as long as the reference count is
86
 
 * positive. Clients should call this method whenever they
87
 
 * create another ongoing reference to an object or interface.
88
 
 * </p>
89
 
 * <p>
90
 
 * This does not have a return value because there is no language
91
 
 * independent type that can refer to an interface or a
92
 
 * class.
93
 
 * </p>
94
 
 */
95
 
 
96
 
static void
97
 
jni_addRef(
98
 
  JNIEnv* env,
99
 
  jobject obj)
100
 
{
101
 
  /*
102
 
   * Declare return and temporary variables.
103
 
   */
104
 
 
105
 
  struct sidl_io_Serializer__object* _ior = NULL;
106
 
 
107
 
  /*
108
 
   * Preprocess Java types and convert into IOR.
109
 
   */
110
 
 
111
 
  _ior = _get_ior(env, obj);
112
 
 
113
 
  /*
114
 
   * Call the IOR method through the EPV.
115
 
   */
116
 
 
117
 
  (*(_ior->d_epv->f_addRef))(
118
 
    _ior->d_object);
119
 
 
120
 
  /*
121
 
   * Postprocess OUT, INOUT, returns, and exceptions.
122
 
   */
123
 
 
124
 
}
125
 
 
126
 
/*
127
 
 * Decrease by one the intrinsic reference count in the underlying
128
 
 * object, and delete the object if the reference is non-positive.
129
 
 * Objects in <code>sidl</code> have an intrinsic reference count.
130
 
 * Clients should call this method whenever they remove a
131
 
 * reference to an object or interface.
132
 
 */
133
 
 
134
 
static void
135
 
jni_deleteRef(
136
 
  JNIEnv* env,
137
 
  jobject obj)
138
 
{
139
 
  /*
140
 
   * Declare return and temporary variables.
141
 
   */
142
 
 
143
 
  struct sidl_io_Serializer__object* _ior = NULL;
144
 
 
145
 
  /*
146
 
   * Preprocess Java types and convert into IOR.
147
 
   */
148
 
 
149
 
  _ior = _get_ior(env, obj);
150
 
 
151
 
  /*
152
 
   * Call the IOR method through the EPV.
153
 
   */
154
 
 
155
 
  (*(_ior->d_epv->f_deleteRef))(
156
 
    _ior->d_object);
157
 
 
158
 
  /*
159
 
   * Postprocess OUT, INOUT, returns, and exceptions.
160
 
   */
161
 
 
162
 
}
163
 
 
164
 
/*
165
 
 * Return true if and only if <code>obj</code> refers to the same
166
 
 * object as this object.
167
 
 */
168
 
 
169
 
static jboolean
170
 
jni_isSame(
171
 
  JNIEnv* env,
172
 
  jobject obj,
173
 
  jobject _arg_iobj)
174
 
{
175
 
  /*
176
 
   * Declare return and temporary variables.
177
 
   */
178
 
 
179
 
  struct sidl_io_Serializer__object* _ior = NULL;
180
 
  struct sidl_BaseInterface__object* _tmp_iobj = (struct 
181
 
    sidl_BaseInterface__object*) NULL;
182
 
  sidl_bool _ior_res = FALSE;
183
 
  jboolean _res = JNI_FALSE;
184
 
 
185
 
  /*
186
 
   * Preprocess Java types and convert into IOR.
187
 
   */
188
 
 
189
 
  _ior = _get_ior(env, obj);
190
 
  _tmp_iobj = (struct sidl_BaseInterface__object*) sidl_Java_J2I_ifc(env,
191
 
    _arg_iobj, "sidl.BaseInterface");
192
 
 
193
 
  /*
194
 
   * Call the IOR method through the EPV.
195
 
   */
196
 
 
197
 
  _ior_res = (*(_ior->d_epv->f_isSame))(
198
 
    _ior->d_object,
199
 
    _tmp_iobj);
200
 
 
201
 
  /*
202
 
   * Postprocess OUT, INOUT, returns, and exceptions.
203
 
   */
204
 
 
205
 
  _res = (jboolean) _ior_res;
206
 
 
207
 
  return _res;
208
 
}
209
 
 
210
 
/*
211
 
 * Check whether the object can support the specified interface or
212
 
 * class.  If the <code>sidl</code> type name in <code>name</code>
213
 
 * is supported, then a reference to that object is returned with the
214
 
 * reference count incremented.  The callee will be responsible for
215
 
 * calling <code>deleteRef</code> on the returned object.  If
216
 
 * the specified type is not supported, then a null reference is
217
 
 * returned.
218
 
 */
219
 
 
220
 
static jobject
221
 
jni_queryInt(
222
 
  JNIEnv* env,
223
 
  jobject obj,
224
 
  jstring _arg_name)
225
 
{
226
 
  /*
227
 
   * Declare return and temporary variables.
228
 
   */
229
 
 
230
 
  struct sidl_io_Serializer__object* _ior = NULL;
231
 
  char* _tmp_name = (char*) NULL;
232
 
  struct sidl_BaseInterface__object* _ior_res = (struct 
233
 
    sidl_BaseInterface__object*) NULL;
234
 
  jobject _res = (jobject) NULL;
235
 
 
236
 
  /*
237
 
   * Preprocess Java types and convert into IOR.
238
 
   */
239
 
 
240
 
  _ior = _get_ior(env, obj);
241
 
  _tmp_name = sidl_Java_J2I_string(env, _arg_name);
242
 
 
243
 
  /*
244
 
   * Call the IOR method through the EPV.
245
 
   */
246
 
 
247
 
  _ior_res = (*(_ior->d_epv->f_queryInt))(
248
 
    _ior->d_object,
249
 
    _tmp_name);
250
 
 
251
 
  /*
252
 
   * Postprocess OUT, INOUT, returns, and exceptions.
253
 
   */
254
 
 
255
 
  sidl_String_free(_tmp_name);
256
 
  _res = sidl_Java_I2J_ifc(env, _ior_res, "sidl.BaseInterface");
257
 
 
258
 
  return _res;
259
 
}
260
 
 
261
 
/*
262
 
 * Return whether this object is an instance of the specified type.
263
 
 * The string name must be the <code>sidl</code> type name.  This
264
 
 * routine will return <code>true</code> if and only if a cast to
265
 
 * the string type name would succeed.
266
 
 */
267
 
 
268
 
static jboolean
269
 
jni_isType(
270
 
  JNIEnv* env,
271
 
  jobject obj,
272
 
  jstring _arg_name)
273
 
{
274
 
  /*
275
 
   * Declare return and temporary variables.
276
 
   */
277
 
 
278
 
  struct sidl_io_Serializer__object* _ior = NULL;
279
 
  char* _tmp_name = (char*) NULL;
280
 
  sidl_bool _ior_res = FALSE;
281
 
  jboolean _res = JNI_FALSE;
282
 
 
283
 
  /*
284
 
   * Preprocess Java types and convert into IOR.
285
 
   */
286
 
 
287
 
  _ior = _get_ior(env, obj);
288
 
  _tmp_name = sidl_Java_J2I_string(env, _arg_name);
289
 
 
290
 
  /*
291
 
   * Call the IOR method through the EPV.
292
 
   */
293
 
 
294
 
  _ior_res = (*(_ior->d_epv->f_isType))(
295
 
    _ior->d_object,
296
 
    _tmp_name);
297
 
 
298
 
  /*
299
 
   * Postprocess OUT, INOUT, returns, and exceptions.
300
 
   */
301
 
 
302
 
  sidl_String_free(_tmp_name);
303
 
  _res = (jboolean) _ior_res;
304
 
 
305
 
  return _res;
306
 
}
307
 
 
308
 
/*
309
 
 * Return the meta-data about the class implementing this interface.
310
 
 */
311
 
 
312
 
static jobject
313
 
jni_getClassInfo(
314
 
  JNIEnv* env,
315
 
  jobject obj)
316
 
{
317
 
  /*
318
 
   * Declare return and temporary variables.
319
 
   */
320
 
 
321
 
  struct sidl_io_Serializer__object* _ior = NULL;
322
 
  struct sidl_ClassInfo__object* _ior_res = (struct sidl_ClassInfo__object*) 
323
 
    NULL;
324
 
  jobject _res = (jobject) NULL;
325
 
 
326
 
  /*
327
 
   * Preprocess Java types and convert into IOR.
328
 
   */
329
 
 
330
 
  _ior = _get_ior(env, obj);
331
 
 
332
 
  /*
333
 
   * Call the IOR method through the EPV.
334
 
   */
335
 
 
336
 
  _ior_res = (*(_ior->d_epv->f_getClassInfo))(
337
 
    _ior->d_object);
338
 
 
339
 
  /*
340
 
   * Postprocess OUT, INOUT, returns, and exceptions.
341
 
   */
342
 
 
343
 
  _res = sidl_Java_I2J_ifc(env, _ior_res, "sidl.ClassInfo");
344
 
 
345
 
  return _res;
346
 
}
347
 
 
348
 
/*
349
 
 * Method:  packBool[]
350
 
 */
351
 
 
352
 
static void
353
 
jni_packBool(
354
 
  JNIEnv* env,
355
 
  jobject obj,
356
 
  jstring _arg_key,
357
 
  jboolean _arg_value)
358
 
{
359
 
  /*
360
 
   * Declare return and temporary variables.
361
 
   */
362
 
 
363
 
  struct sidl_io_Serializer__object* _ior = NULL;
364
 
  char* _tmp_key = (char*) NULL;
365
 
  sidl_bool _tmp_value = FALSE;
366
 
  struct sidl_BaseInterface__object* _ex = NULL;
367
 
 
368
 
  /*
369
 
   * Preprocess Java types and convert into IOR.
370
 
   */
371
 
 
372
 
  _ior = _get_ior(env, obj);
373
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
374
 
  _tmp_value = (sidl_bool) _arg_value;
375
 
 
376
 
  /*
377
 
   * Call the IOR method through the EPV.
378
 
   */
379
 
 
380
 
  (*(_ior->d_epv->f_packBool))(
381
 
    _ior->d_object,
382
 
    _tmp_key,
383
 
    _tmp_value,
384
 
    &_ex);
385
 
 
386
 
  /*
387
 
   * Postprocess OUT, INOUT, returns, and exceptions.
388
 
   */
389
 
 
390
 
  sidl_String_free(_tmp_key);
391
 
  sidl_Java_CheckException(
392
 
    env,
393
 
    _ex,
394
 
    "sidl.io.IOException",
395
 
    NULL);
396
 
}
397
 
 
398
 
/*
399
 
 * Method:  packChar[]
400
 
 */
401
 
 
402
 
static void
403
 
jni_packChar(
404
 
  JNIEnv* env,
405
 
  jobject obj,
406
 
  jstring _arg_key,
407
 
  jchar _arg_value)
408
 
{
409
 
  /*
410
 
   * Declare return and temporary variables.
411
 
   */
412
 
 
413
 
  struct sidl_io_Serializer__object* _ior = NULL;
414
 
  char* _tmp_key = (char*) NULL;
415
 
  char _tmp_value = (char) 0;
416
 
  struct sidl_BaseInterface__object* _ex = NULL;
417
 
 
418
 
  /*
419
 
   * Preprocess Java types and convert into IOR.
420
 
   */
421
 
 
422
 
  _ior = _get_ior(env, obj);
423
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
424
 
  _tmp_value = (char) _arg_value;
425
 
 
426
 
  /*
427
 
   * Call the IOR method through the EPV.
428
 
   */
429
 
 
430
 
  (*(_ior->d_epv->f_packChar))(
431
 
    _ior->d_object,
432
 
    _tmp_key,
433
 
    _tmp_value,
434
 
    &_ex);
435
 
 
436
 
  /*
437
 
   * Postprocess OUT, INOUT, returns, and exceptions.
438
 
   */
439
 
 
440
 
  sidl_String_free(_tmp_key);
441
 
  sidl_Java_CheckException(
442
 
    env,
443
 
    _ex,
444
 
    "sidl.io.IOException",
445
 
    NULL);
446
 
}
447
 
 
448
 
/*
449
 
 * Method:  packInt[]
450
 
 */
451
 
 
452
 
static void
453
 
jni_packInt(
454
 
  JNIEnv* env,
455
 
  jobject obj,
456
 
  jstring _arg_key,
457
 
  jint _arg_value)
458
 
{
459
 
  /*
460
 
   * Declare return and temporary variables.
461
 
   */
462
 
 
463
 
  struct sidl_io_Serializer__object* _ior = NULL;
464
 
  char* _tmp_key = (char*) NULL;
465
 
  int32_t _tmp_value = 0;
466
 
  struct sidl_BaseInterface__object* _ex = NULL;
467
 
 
468
 
  /*
469
 
   * Preprocess Java types and convert into IOR.
470
 
   */
471
 
 
472
 
  _ior = _get_ior(env, obj);
473
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
474
 
  _tmp_value = (int32_t) _arg_value;
475
 
 
476
 
  /*
477
 
   * Call the IOR method through the EPV.
478
 
   */
479
 
 
480
 
  (*(_ior->d_epv->f_packInt))(
481
 
    _ior->d_object,
482
 
    _tmp_key,
483
 
    _tmp_value,
484
 
    &_ex);
485
 
 
486
 
  /*
487
 
   * Postprocess OUT, INOUT, returns, and exceptions.
488
 
   */
489
 
 
490
 
  sidl_String_free(_tmp_key);
491
 
  sidl_Java_CheckException(
492
 
    env,
493
 
    _ex,
494
 
    "sidl.io.IOException",
495
 
    NULL);
496
 
}
497
 
 
498
 
/*
499
 
 * Method:  packLong[]
500
 
 */
501
 
 
502
 
static void
503
 
jni_packLong(
504
 
  JNIEnv* env,
505
 
  jobject obj,
506
 
  jstring _arg_key,
507
 
  jlong _arg_value)
508
 
{
509
 
  /*
510
 
   * Declare return and temporary variables.
511
 
   */
512
 
 
513
 
  struct sidl_io_Serializer__object* _ior = NULL;
514
 
  char* _tmp_key = (char*) NULL;
515
 
  int64_t _tmp_value = 0;
516
 
  struct sidl_BaseInterface__object* _ex = NULL;
517
 
 
518
 
  /*
519
 
   * Preprocess Java types and convert into IOR.
520
 
   */
521
 
 
522
 
  _ior = _get_ior(env, obj);
523
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
524
 
  _tmp_value = (int64_t) _arg_value;
525
 
 
526
 
  /*
527
 
   * Call the IOR method through the EPV.
528
 
   */
529
 
 
530
 
  (*(_ior->d_epv->f_packLong))(
531
 
    _ior->d_object,
532
 
    _tmp_key,
533
 
    _tmp_value,
534
 
    &_ex);
535
 
 
536
 
  /*
537
 
   * Postprocess OUT, INOUT, returns, and exceptions.
538
 
   */
539
 
 
540
 
  sidl_String_free(_tmp_key);
541
 
  sidl_Java_CheckException(
542
 
    env,
543
 
    _ex,
544
 
    "sidl.io.IOException",
545
 
    NULL);
546
 
}
547
 
 
548
 
/*
549
 
 * Method:  packFloat[]
550
 
 */
551
 
 
552
 
static void
553
 
jni_packFloat(
554
 
  JNIEnv* env,
555
 
  jobject obj,
556
 
  jstring _arg_key,
557
 
  jfloat _arg_value)
558
 
{
559
 
  /*
560
 
   * Declare return and temporary variables.
561
 
   */
562
 
 
563
 
  struct sidl_io_Serializer__object* _ior = NULL;
564
 
  char* _tmp_key = (char*) NULL;
565
 
  float _tmp_value = 0.0;
566
 
  struct sidl_BaseInterface__object* _ex = NULL;
567
 
 
568
 
  /*
569
 
   * Preprocess Java types and convert into IOR.
570
 
   */
571
 
 
572
 
  _ior = _get_ior(env, obj);
573
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
574
 
  _tmp_value = (float) _arg_value;
575
 
 
576
 
  /*
577
 
   * Call the IOR method through the EPV.
578
 
   */
579
 
 
580
 
  (*(_ior->d_epv->f_packFloat))(
581
 
    _ior->d_object,
582
 
    _tmp_key,
583
 
    _tmp_value,
584
 
    &_ex);
585
 
 
586
 
  /*
587
 
   * Postprocess OUT, INOUT, returns, and exceptions.
588
 
   */
589
 
 
590
 
  sidl_String_free(_tmp_key);
591
 
  sidl_Java_CheckException(
592
 
    env,
593
 
    _ex,
594
 
    "sidl.io.IOException",
595
 
    NULL);
596
 
}
597
 
 
598
 
/*
599
 
 * Method:  packDouble[]
600
 
 */
601
 
 
602
 
static void
603
 
jni_packDouble(
604
 
  JNIEnv* env,
605
 
  jobject obj,
606
 
  jstring _arg_key,
607
 
  jdouble _arg_value)
608
 
{
609
 
  /*
610
 
   * Declare return and temporary variables.
611
 
   */
612
 
 
613
 
  struct sidl_io_Serializer__object* _ior = NULL;
614
 
  char* _tmp_key = (char*) NULL;
615
 
  double _tmp_value = 0.0;
616
 
  struct sidl_BaseInterface__object* _ex = NULL;
617
 
 
618
 
  /*
619
 
   * Preprocess Java types and convert into IOR.
620
 
   */
621
 
 
622
 
  _ior = _get_ior(env, obj);
623
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
624
 
  _tmp_value = (double) _arg_value;
625
 
 
626
 
  /*
627
 
   * Call the IOR method through the EPV.
628
 
   */
629
 
 
630
 
  (*(_ior->d_epv->f_packDouble))(
631
 
    _ior->d_object,
632
 
    _tmp_key,
633
 
    _tmp_value,
634
 
    &_ex);
635
 
 
636
 
  /*
637
 
   * Postprocess OUT, INOUT, returns, and exceptions.
638
 
   */
639
 
 
640
 
  sidl_String_free(_tmp_key);
641
 
  sidl_Java_CheckException(
642
 
    env,
643
 
    _ex,
644
 
    "sidl.io.IOException",
645
 
    NULL);
646
 
}
647
 
 
648
 
/*
649
 
 * Method:  packFcomplex[]
650
 
 */
651
 
 
652
 
static void
653
 
jni_packFcomplex(
654
 
  JNIEnv* env,
655
 
  jobject obj,
656
 
  jstring _arg_key,
657
 
  jobject _arg_value)
658
 
{
659
 
  /*
660
 
   * Declare return and temporary variables.
661
 
   */
662
 
 
663
 
  struct sidl_io_Serializer__object* _ior = NULL;
664
 
  char* _tmp_key = (char*) NULL;
665
 
  struct sidl_fcomplex _tmp_value = { 0.0, 0.0 };
666
 
  struct sidl_BaseInterface__object* _ex = NULL;
667
 
 
668
 
  /*
669
 
   * Preprocess Java types and convert into IOR.
670
 
   */
671
 
 
672
 
  _ior = _get_ior(env, obj);
673
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
674
 
  _tmp_value = sidl_Java_J2I_fcomplex(env, _arg_value);
675
 
 
676
 
  /*
677
 
   * Call the IOR method through the EPV.
678
 
   */
679
 
 
680
 
  (*(_ior->d_epv->f_packFcomplex))(
681
 
    _ior->d_object,
682
 
    _tmp_key,
683
 
    _tmp_value,
684
 
    &_ex);
685
 
 
686
 
  /*
687
 
   * Postprocess OUT, INOUT, returns, and exceptions.
688
 
   */
689
 
 
690
 
  sidl_String_free(_tmp_key);
691
 
  sidl_Java_CheckException(
692
 
    env,
693
 
    _ex,
694
 
    "sidl.io.IOException",
695
 
    NULL);
696
 
}
697
 
 
698
 
/*
699
 
 * Method:  packDcomplex[]
700
 
 */
701
 
 
702
 
static void
703
 
jni_packDcomplex(
704
 
  JNIEnv* env,
705
 
  jobject obj,
706
 
  jstring _arg_key,
707
 
  jobject _arg_value)
708
 
{
709
 
  /*
710
 
   * Declare return and temporary variables.
711
 
   */
712
 
 
713
 
  struct sidl_io_Serializer__object* _ior = NULL;
714
 
  char* _tmp_key = (char*) NULL;
715
 
  struct sidl_dcomplex _tmp_value = { 0.0, 0.0 };
716
 
  struct sidl_BaseInterface__object* _ex = NULL;
717
 
 
718
 
  /*
719
 
   * Preprocess Java types and convert into IOR.
720
 
   */
721
 
 
722
 
  _ior = _get_ior(env, obj);
723
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
724
 
  _tmp_value = sidl_Java_J2I_dcomplex(env, _arg_value);
725
 
 
726
 
  /*
727
 
   * Call the IOR method through the EPV.
728
 
   */
729
 
 
730
 
  (*(_ior->d_epv->f_packDcomplex))(
731
 
    _ior->d_object,
732
 
    _tmp_key,
733
 
    _tmp_value,
734
 
    &_ex);
735
 
 
736
 
  /*
737
 
   * Postprocess OUT, INOUT, returns, and exceptions.
738
 
   */
739
 
 
740
 
  sidl_String_free(_tmp_key);
741
 
  sidl_Java_CheckException(
742
 
    env,
743
 
    _ex,
744
 
    "sidl.io.IOException",
745
 
    NULL);
746
 
}
747
 
 
748
 
/*
749
 
 * Method:  packString[]
750
 
 */
751
 
 
752
 
static void
753
 
jni_packString(
754
 
  JNIEnv* env,
755
 
  jobject obj,
756
 
  jstring _arg_key,
757
 
  jstring _arg_value)
758
 
{
759
 
  /*
760
 
   * Declare return and temporary variables.
761
 
   */
762
 
 
763
 
  struct sidl_io_Serializer__object* _ior = NULL;
764
 
  char* _tmp_key = (char*) NULL;
765
 
  char* _tmp_value = (char*) NULL;
766
 
  struct sidl_BaseInterface__object* _ex = NULL;
767
 
 
768
 
  /*
769
 
   * Preprocess Java types and convert into IOR.
770
 
   */
771
 
 
772
 
  _ior = _get_ior(env, obj);
773
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
774
 
  _tmp_value = sidl_Java_J2I_string(env, _arg_value);
775
 
 
776
 
  /*
777
 
   * Call the IOR method through the EPV.
778
 
   */
779
 
 
780
 
  (*(_ior->d_epv->f_packString))(
781
 
    _ior->d_object,
782
 
    _tmp_key,
783
 
    _tmp_value,
784
 
    &_ex);
785
 
 
786
 
  /*
787
 
   * Postprocess OUT, INOUT, returns, and exceptions.
788
 
   */
789
 
 
790
 
  sidl_String_free(_tmp_key);
791
 
  sidl_String_free(_tmp_value);
792
 
  sidl_Java_CheckException(
793
 
    env,
794
 
    _ex,
795
 
    "sidl.io.IOException",
796
 
    NULL);
797
 
}
798
 
 
799
 
/*
800
 
 * Register JNI methods with the Java JVM.
801
 
 */
802
 
 
803
 
void sidl_io_Serializer__register(JNIEnv* env)
804
 
{
805
 
  JNINativeMethod methods[15];
806
 
  jclass cls;
807
 
 
808
 
  methods[0].name      = "addRef";
809
 
  methods[0].signature = "()V";
810
 
  methods[0].fnPtr     = (void *)jni_addRef;
811
 
  methods[1].name      = "deleteRef";
812
 
  methods[1].signature = "()V";
813
 
  methods[1].fnPtr     = (void *)jni_deleteRef;
814
 
  methods[2].name      = "isSame";
815
 
  methods[2].signature = "(Lsidl/BaseInterface;)Z";
816
 
  methods[2].fnPtr     = (void *)jni_isSame;
817
 
  methods[3].name      = "queryInt";
818
 
  methods[3].signature = "(Ljava/lang/String;)Lsidl/BaseInterface;";
819
 
  methods[3].fnPtr     = (void *)jni_queryInt;
820
 
  methods[4].name      = "isType";
821
 
  methods[4].signature = "(Ljava/lang/String;)Z";
822
 
  methods[4].fnPtr     = (void *)jni_isType;
823
 
  methods[5].name      = "getClassInfo";
824
 
  methods[5].signature = "()Lsidl/ClassInfo;";
825
 
  methods[5].fnPtr     = (void *)jni_getClassInfo;
826
 
  methods[6].name      = "packBool";
827
 
  methods[6].signature = "(Ljava/lang/String;Z)V";
828
 
  methods[6].fnPtr     = (void *)jni_packBool;
829
 
  methods[7].name      = "packChar";
830
 
  methods[7].signature = "(Ljava/lang/String;C)V";
831
 
  methods[7].fnPtr     = (void *)jni_packChar;
832
 
  methods[8].name      = "packInt";
833
 
  methods[8].signature = "(Ljava/lang/String;I)V";
834
 
  methods[8].fnPtr     = (void *)jni_packInt;
835
 
  methods[9].name      = "packLong";
836
 
  methods[9].signature = "(Ljava/lang/String;J)V";
837
 
  methods[9].fnPtr     = (void *)jni_packLong;
838
 
  methods[10].name      = "packFloat";
839
 
  methods[10].signature = "(Ljava/lang/String;F)V";
840
 
  methods[10].fnPtr     = (void *)jni_packFloat;
841
 
  methods[11].name      = "packDouble";
842
 
  methods[11].signature = "(Ljava/lang/String;D)V";
843
 
  methods[11].fnPtr     = (void *)jni_packDouble;
844
 
  methods[12].name      = "packFcomplex";
845
 
  methods[12].signature = "(Ljava/lang/String;Lsidl/FloatComplex;)V";
846
 
  methods[12].fnPtr     = (void *)jni_packFcomplex;
847
 
  methods[13].name      = "packDcomplex";
848
 
  methods[13].signature = "(Ljava/lang/String;Lsidl/DoubleComplex;)V";
849
 
  methods[13].fnPtr     = (void *)jni_packDcomplex;
850
 
  methods[14].name      = "packString";
851
 
  methods[14].signature = "(Ljava/lang/String;Ljava/lang/String;)V";
852
 
  methods[14].fnPtr     = (void *)jni_packString;
853
 
 
854
 
 
855
 
  cls = (*env)->FindClass(env, "sidl/io/Serializer$Wrapper");
856
 
  if (cls) {
857
 
    (*env)->RegisterNatives(env, cls, methods, 15);
858
 
    (*env)->DeleteLocalRef(env, cls);
859
 
  }
860
 
}