Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

pass nested structs through JNI

Thread view: 
jobs239@hotmail.com - 07 Aug 2006 17:22 GMT
I need to pass a nested struct as argument to JNI function e.g.
struct A {
    int a
    struct B
}

struct B {
   long b
   struct B * next
}

What is a good way to do this. I think I can use GetFieldID and
SetField for each field but since the structs are big its very
cumbersome.

Should I just pass a string of values and compose this data structure
on the java side. What other options do I have?
Gordon Beaton - 07 Aug 2006 20:13 GMT
> I need to pass a nested struct as argument to JNI function e.g.
>
[quoted text clipped - 9 lines]
>
> What is a good way to do this.

A good way to do *what*?

> I think I can use GetFieldID and SetField for each field but since
> the structs are big its very cumbersome.
>
> Should I just pass a string of values and compose this data
> structure on the java side. What other options do I have?

It's far from clear what you're trying to do exactly. GetFieldID() etc
are for accessing fields in Java objects, but those C structs cannot
be fields in a Java object.

When you say "JNI function", are you referring to native methods,
parts of the JNI API, or C functions in general?

/gordon

Signature

[ don't email me support questions or followups ]
g o r d o n  +  n e w s  @  b a l d e r 1 3 . s e



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.