Skip to content
/ JNIGlue Public

Generate nicer glue for Java Native Interface (JNI)

Notifications You must be signed in to change notification settings

ldo/JNIGlue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

The enclosed Python script reads jni.h (for example, as included with
the Android NDK) and generates nicer wrapper glue for calling JNI
routines from C. For example, the FindClass routine normally has to be
called something like this:

    the_class = (**env).FindClass(env, class_name);

but JNIGlue generates a wrapper that looks like this:

    static inline jclass JNFindClass(JNIEnv* env, const char* a1)
      {
        return
            (**env).FindClass(env, a1);
      } /*FindClass*/

allowing for slightly more convenient invocation like this:

    the_class = JNFindClass(env, class_name);

All the wrapper routines are generated with names consisting of the
original JNI routine name prefixed with “JN”. If you don’t like it,
change it.

Lawrence D'Oliveiro <[email protected]>

About

Generate nicer glue for Java Native Interface (JNI)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages