| From | Sent On | Attachments |
|---|---|---|
| Paul Loy | Jun 5, 2008 4:58 am | |
| evgeni shafran | Jun 5, 2008 5:57 am |
| Subject: | Re: [jna-users] help with stucture transform. | |
|---|---|---|
| From: | Paul Loy (kete...@gmail.com) | |
| Date: | Jun 5, 2008 4:58:51 am | |
| List: | net.java.dev.jna.users | |
int
On Thu, Jun 5, 2008 at 12:58 PM, evgeni shafran <yavj...@gmail.com> wrote:
i have a tructure in c that i need to transform into jna:
*
typedef * *enum*
{
IDLE,
PREALARM,
ALARM,
ALERT,
TAPE
} State;
*
typedef * *struct*
{
*int* size;
*bool* valid;
*bool* active;
*bool* signal;
State state;
*int* last_write_index;
*int* last_read_index;
time_t last_image_time;
*int* last_event;
*int* action;
*int* brightness;
*int* hue;
*int* colour;
*int* contrast;
*int* alarm_x;
*int* alarm_y;
*char* control_state[256];
} SharedData;
i tried to transform it and made:
import com.sun.jna.Pointer;
public class SharedData extends Structure { public int size; public boolean valid; public boolean active; public boolean signal; //public state; public int last_write_index; public int last_read_index; public long last_image_time; public int last_event; public int action; public int brightness; public int hue; public int colour; public int contrast; public int alarm_x; public int alarm_y; public byte[] control_state= new byte[256]; @Override protected void useMemory(Pointer m) { super.useMemory(m); super.read(); } @Override protected void useMemory(Pointer m, int offset) { super.useMemory(m, offset); }
}
i didnt find a way to transform enum into jna. to what transforms enum?
--
--------------------------------------------- Paul Loy pa...@keteracel.com http://www.keteracel.com/paul





