[Top][All Lists]

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

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

From: Daishi Kato
Subject: Re: [Chicken-users] jni wrapper (possible?)
Date: Tue, 15 Nov 2005 08:11:27 +0900
User-agent: Wanderlust/2.15.1 (Almost Unreal) Emacs/21.4 Mule/5.0 (SAKAKI)

At Mon, 14 Nov 2005 18:43:10 +0100,
felix winkelmann wrote:
> 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).

Yeah, this is what I want.
Due to my limited experience with FFI,
I would really appreciate if you could provide
me a simple example. To fill somethign like the following:

(define jni:call-static-void-method
  (forien-lambda* void ((c-pointer clazz) (c-pointer methodid)
                        (scheme-object args))
    "jvalue* cargs = <do something here>;"
    "if(env == 0){ init_jvm(); }"
    "(*env)->CallStaticVoidMethodA(env, clazz, methodid, cargs);"

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

oops, sorry, forgot to attach.
to this email. it's hand-written...
There would be also needed jni-util.scm to handle strings and arrays,
in more scheme way, since JNI uses basically pointers...

I'm also pretty new to write an egg from scratch,
please correct me if something is wrong or should be modified.
(especially for (declare ...))


Attachment: jni.scm
Description: Binary data

reply via email to

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