Back to index

lightning-sunbird  0.9+nobinonly
Typedefs | Functions | Variables
JavaVMFramework.cpp File Reference
#include <jni.h>
#include <JavaControl.h>
#include <CFURL.h>
#include <CFBundle.h>
#include <CFString.h>
#include <MacErrors.h>

Go to the source code of this file.

Typedefs

typedef jint JNICALL(* JNI_GetDefaultJavaVMInitArgs_proc_ptr )(void *args)
typedef jint JNICALL(* JNI_CreateJavaVM_proc_ptr )(JavaVM **pvm, void **penv, void *args)

Functions

static CFBundleRef getBundle (CFStringRef frameworkPath)
static voidgetJavaVMFunction (CFStringRef functionName)
_JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_GetDefaultJavaVMInitArgs (void *args)
_JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM (JavaVM **pvm, void **penv, void *args)

Variables

static
JNI_GetDefaultJavaVMInitArgs_proc_ptr 
_JNI_GetDefaultJavaVMInitArgs = (JNI_GetDefaultJavaVMInitArgs_proc_ptr) getJavaVMFunction(CFSTR("JNI_GetDefaultJavaVMInitArgs"))
static JNI_CreateJavaVM_proc_ptr _JNI_CreateJavaVM = (JNI_CreateJavaVM_proc_ptr) getJavaVMFunction(CFSTR("JNI_CreateJavaVM"))

Typedef Documentation

typedef jint JNICALL(* JNI_CreateJavaVM_proc_ptr)(JavaVM **pvm, void **penv, void *args)

Definition at line 108 of file JavaVMFramework.cpp.

Definition at line 95 of file JavaVMFramework.cpp.


Function Documentation

static CFBundleRef getBundle ( CFStringRef  frameworkPath) [static]

Definition at line 54 of file JavaVMFramework.cpp.

{
       CFBundleRef bundle = NULL;
    
       //     Make a CFURLRef from the CFString representation of the bundle's path.
       //     See the Core Foundation URL Services chapter for details.
       CFURLRef bundleURL = CFURLCreateWithFileSystemPath(NULL, frameworkPath, kCFURLPOSIXPathStyle, true);
       if (bundleURL != NULL) {
        bundle = CFBundleCreate(NULL, bundleURL);
        if (bundle != NULL)
              CFBundleLoadExecutable(bundle);
        CFRelease(bundleURL);
       }
       
       return bundle;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void* getJavaVMFunction ( CFStringRef  functionName) [static]

Definition at line 88 of file JavaVMFramework.cpp.

{
  static CFBundleRef javaBundle = getBundle(CFSTR("/System/Library/Frameworks/JavaVM.framework"));
  if (javaBundle) return CFBundleGetFunctionPointerForName(javaBundle, functionName);
  return NULL;
}

Here is the call graph for this function:

_JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM ( JavaVM **  pvm,
void **  penv,
void args 
)

Definition at line 112 of file JavaVMFramework.cpp.

{
#if DEBUG
    kprintf("_JNI_CreateJavaVM = 0x%08X\n", _JNI_CreateJavaVM);
#endif
    if (_JNI_CreateJavaVM) return _JNI_CreateJavaVM(pvm, penv, args);
    return -1;
}

Definition at line 99 of file JavaVMFramework.cpp.

{
#if DEBUG
    kprintf("_JNI_GetDefaultJavaVMInitArgs = 0x%08X\n", _JNI_GetDefaultJavaVMInitArgs);
#endif
    if (_JNI_GetDefaultJavaVMInitArgs) return _JNI_GetDefaultJavaVMInitArgs(args);
    return -1;
}

Here is the caller graph for this function:


Variable Documentation

Definition at line 109 of file JavaVMFramework.cpp.

Definition at line 96 of file JavaVMFramework.cpp.