2 messages in net.java.dev.jna.users[jna-users] C String as output parameter
FromSent OnAttachments
amina guermoucheSep 2, 2008 1:30 am 
Michael Brewer-DavisSep 2, 2008 8:56 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] C String as output parameterActions...
From:amina guermouche (guer@yahoo.fr)
Date:Sep 2, 2008 1:30:13 am
List:net.java.dev.jna.users

Hie,

I have these C functions: parse_command_line(char ** meshfile) check_acces_file(char * meshfile) They are called in the main function this way: parse_command_line(&meshfile) check_access_file(meshfile)

The meshfile gets its value in the function parse_command_line and then the
function check_acces_file uses this value.

I've read in a previous message that if I wanted a C String to be a parameter
and an output value at the same time, I should use ByteBuffer or Byte []

I don't know how to manage the fact that meshfile is user once as a char ** and
once as a char *.

I've tried to use ByteBuffer in both functions, but the value of the meshfile
is: java.nio.HeapByteBuffer[pos=0 lim=100 cap=100] instead of the name of an
existing file (I've verified the value of meshfile in the C function
parse_command_line and it's correct)

Thanks.