6 messages in net.java.dev.jna.usersRe: [jna-users] Reading a native array
FromSent OnAttachments
ThinnerDec 13, 2008 5:06 am 
Timothy WallDec 13, 2008 5:11 am 
ThinnerDec 13, 2008 5:15 am 
Timothy WallDec 13, 2008 5:32 am 
ThinnerDec 13, 2008 6:17 am 
Timothy WallDec 13, 2008 9:00 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:Re: [jna-users] Reading a native arrayActions...
From:Timothy Wall (twal@dev.java.net)
Date:Dec 13, 2008 5:11:56 am
List:net.java.dev.jna.users

primitive arrays within a struct are inlined. you need a pointer type.

On Dec 13, 2008, at 8:07 AM, Thinner wrote:

Hello again everyone.

I'm trying to read a native char* from my Java app but I keep getting seg fault.

struct stru{ int length; char* data; }

struct stru *return_value some_function(){ }

public class stru extends Structure{ public static class ByReference extends stru implements Structure.ByReference{}

int length; byte[] data;

public stru{ data = new byte[1]; } }

public static void main(String[] args){ myLibrary.INSTANCE }

Nor a spork, I suppose.