2 messages in net.java.dev.jna.users[jna-users] output structure as param...
FromSent OnAttachments
amina guermoucheSep 5, 2008 7:17 am 
Timothy WallSep 5, 2008 10:59 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[jna-users] output structure as parameterActions...
From:amina guermouche (guer@yahoo.fr)
Date:Sep 5, 2008 7:17:23 am
List:net.java.dev.jna.users

Hie,

I have these C functions: compute_score(mesh_t * mesh) where mesh_t is a
structure

It's called in the main function this way: compute_score(mesh) //mesh is declared as a mesh_t *

The function compute_score modifies (initializes) the variable mesh. I need to access to an attribute of the structure and read its value, for
example: filename = mesh->data[SPARSE]->filename[0];

I've tried to do this this way (like for a char *): PointerByReference meshRef=new PointerByReference(); Pointer meshPtr=meshRef.getPointer(); mesh_t mesh=new mesh(); /////////////////////////// compute_score(meshRef); //////////////////////////// Pointer=meshPtr.getPointer();

And here, I don't know what to to (if it was an int, I'd have done:
mesh=meshPtr.getInt(0));

Thanks.