× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




I'm looking at the IBM-supplied copybook for the JNI APIs in QSYSINC. It defines jvalue as follows:

      D jvalue          DS                  QUALIFIED
      D                                     BASED(jvalue_P)
      D   z                                 LIKE(jboolean)
      D   b                                 LIKE(jbyte)
      D   c                                 LIKE(jchar)
      D   s                                 LIKE(jshort)
      D   i                                 LIKE(jint)
      D   j                                 LIKE(jlong)
      D   f                                 LIKE(jfloat)
      D   d                                 LIKE(jdouble)
      D   l                                 LIKE(jint)

Is this correct? The reason I ask is that when I use JNI on FreeBSD from C programs, the jvalue definition looks like this:

typedef union jvalue {
    jboolean z;
    jbyte    b;
    jchar    c;
    jshort   s;
    jint     i;
    jlong    j;
    jfloat   f;
    jdouble  d;
    jobject  l;
} jvalue;

The big difference is that the RPG definitions are a data structure. The C definitions are a union!

Shouldn't the RPG definition look like the following?

      D jvalue          DS                  QUALIFIED
      D                                     BASED(jvalue_P)
      D   z                                 LIKE(jboolean)
      D                                     overlay(jvalue:1)
      D   b                                 LIKE(jbyte)
      D                                     overlay(jvalue:1)
      D   c                                 LIKE(jchar)
      D                                     overlay(jvalue:1)
      D   s                                 LIKE(jshort)
      D                                     overlay(jvalue:1)
      D   i                                 LIKE(jint)
      D                                     overlay(jvalue:1)
      D   j                                 LIKE(jlong)
      D                                     overlay(jvalue:1)
      D   f                                 LIKE(jfloat)
      D                                     overlay(jvalue:1)
      D   d                                 LIKE(jdouble)
      D                                     overlay(jvalue:1)
      D   l                                 LIKE(jint)
      D                                     overlay(jvalue:1)

Or does JNI work differently on the System i than it does on FreeBSD? ( or am I just nuts? )


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.