NativeLibrary.getGlobalVariableAddress() is provided to look up
globals, e.g.
Pointer p =
NativeLibarary
.getInstance
("CoreFoundation").getGlobalVariableAddress("kCFRunLoopDefaultMode");
You can then dereference the pointer as appropriate for the variable
type.
On Jan 13, 2009, at 6:21 PM, Alan Snyder wrote:
A very specific question about Mac's OS X Foundation Library. Given
the snippet of this header file in Apple's CoreFoundation library
how would one define the constant:
CF_EXPORT const CFStringRef kCFRunLoopDefaultMode;
in a JNA Library interface?
Any comments appreciated.
Alan
P.S. I'll ask this question over at Rococoa too.
-----------------
/* CFRunLoop.h
Copyright (c) 1998-2007, Apple Inc. All rights reserved.
*/
#if !defined(__COREFOUNDATION_CFRUNLOOP__)
#define __COREFOUNDATION_CFRUNLOOP__ 1
#include <CoreFoundation/CFBase.h>
#include <CoreFoundation/CFArray.h>
#include <CoreFoundation/CFDate.h>
#include <CoreFoundation/CFString.h>
#if defined(__MACH__)
#include <mach/port.h>
#endif
CF_EXTERN_C_BEGIN
typedef struct __CFRunLoop * CFRunLoopRef;
:
:
:
/* Reasons for CFRunLoopRunInMode() to Return */
enum {
kCFRunLoopRunFinished = 1,
kCFRunLoopRunStopped = 2,
kCFRunLoopRunTimedOut = 3,
kCFRunLoopRunHandledSource = 4
};
CF_EXPORT const CFStringRef kCFRunLoopDefaultMode;
CF_EXPORT const CFStringRef kCFRunLoopCommonModes;