chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] jni wrapper (possible?)


From: felix winkelmann
Subject: Re: [Chicken-users] jni wrapper (possible?)
Date: Mon, 14 Nov 2005 18:43:10 +0100

On 11/13/05, Daishi Kato <address@hidden> wrote:
>
> I am thinking of wappring JNI (Java Native Interface)
> for chicken.  The problem I'm facing right now is
> that I don't know how to wrap va_list arguments.

JNI wrappers would be nice, indeed.

>
> from jni.h
>   void     (JNICALL *CallStaticVoidMethod)    (JNIEnv *, jclass, jmethodID,
>                                                ...);
>   void     (JNICALL *CallStaticVoidMethodV)   (JNIEnv *, jclass, jmethodID,
>                                                _Jv_va_list);
>   void     (JNICALL *CallStaticVoidMethodA)   (JNIEnv *, jclass, jmethodID,
>                                                jvalue *);
> one of these should be wrapped.
> The point is that I need to specify types from the caller.
> I'd like to ask if it is possible, and give me a hint.
>

Unfortunately, varargs can't be wrapped properly,
I suggest you use the ...A versions. You probably want
to map the argument list to your wrapper into a jvalue *.
You should have type-information directly from the
passed arguments and could build the jvalue-Array
before the call (Unless I misunderstand your intentions).


> Attached file is my work so far.

Sorry, I can't find the attachment. Could you send it
again?


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]