1 package com.acme; 2 3 import java.nicl.metadata.Offset; 4 import java.nicl.metadata.NativeHeader; 5 import java.nicl.metadata.NativeLocation; 6 import java.nicl.metadata.NativeStruct; 7 import java.nicl.metadata.NativeType; 8 import java.math.BigDecimal; 9 import java.nicl.types.Pointer; 10 import java.nicl.types.Struct; 11 12 /** 13 * This test is platform dependent, as the C type size may vary on platform. 14 * Current value is based on x64 with __LP64__. 15 */ 16 @NativeHeader(path="simple.h") 17 public interface simple { 18 @NativeLocation(file="simple.h", line=1, column=5, USR="") 19 @NativeType(name="global", layout="i", ctype="int") 20 public int global$get(); 21 public void global$set(int arg); 22 public Pointer<Integer> global$ptr(); 23 24 @NativeLocation(file="simple.h", line=7, column=8, USR="") 25 @NativeStruct("[cosilqFDE]") 26 @NativeType(layout="[cosilqFDE]", ctype = "struct anonymous") 27 public static interface anonymous extends Struct<anonymous> { 28 @NativeLocation(file="simple.h", line=8, column=10, USR="") 29 @NativeType(name="ch", layout="c", ctype="char") 30 @Offset(offset=0) 31 public byte ch$get(); 32 public void ch$set(byte arg); 33 public Pointer<Byte> ch$ptr(); 34 35 @NativeLocation(file="simple.h", line=9, column=17, USR="") 36 @NativeType(name="sch", layout="o", ctype="signed char") 37 @Offset(offset=8) 38 public byte sch$get(); 39 public void sch$set(byte arg); 40 public Pointer<Byte> sch$ptr(); 41 42 @NativeLocation(file="simple.h", line=10, column=11, USR="") 43 @NativeType(name="s", layout="s", ctype="short") 44 @Offset(offset=16) 45 public short s$get(); 46 public void s$set(short arg); 47 public Pointer<Short> s$ptr(); 48 49 @NativeLocation(file="simple.h", line=11, column=9, USR="") 50 @NativeType(name="n", layout="i", ctype="int") 51 @Offset(offset=32) 52 public int n$get(); 53 public void n$set(int arg); 54 public Pointer<Integer> n$ptr(); 55 56 @NativeLocation(file="simple.h", line=12, column=10, USR="") 57 @NativeType(name="l", layout="l", ctype="long") 58 @Offset(offset=64) 59 public long l$get(); 60 public void l$set(long arg); 61 public Pointer<Long> l$ptr(); 62 63 @NativeLocation(file="simple.h", line=13, column=15, USR="") 64 @NativeType(name="ll", layout="q", ctype="long long") 65 @Offset(offset=128) 66 public long ll$get(); 67 public void ll$set(long arg); 68 public Pointer<Long> ll$ptr(); 69 70 @NativeLocation(file="simple.h", line=14, column=11, USR="") 71 @NativeType(name="f", layout="F", ctype="float") 72 @Offset(offset=192) 73 public float f$get(); 74 public void f$set(float arg); 75 public Pointer<Float> f$ptr(); 76 77 @NativeLocation(file="simple.h", line=15, column=12, USR="") 78 @NativeType(name="d", layout="D", ctype="double") 79 @Offset(offset=256) 80 public double d$get(); 81 public void d$set(double arg); 82 public Pointer<Double> d$ptr(); 83 84 @NativeLocation(file="simple.h", line=16, column=17, USR="") 85 @NativeType(name="ld", layout="E", ctype="long double") 86 @Offset(offset=384) 87 public BigDecimal ld$get(); 88 public void ld$set(BigDecimal arg); 89 public Pointer<BigDecimal> ld$ptr(); 90 } 91 92 @NativeLocation(file="simple.h", line=17, column=3, USR="") 93 @NativeType(name="basics", layout="[cosilqFDE]", ctype="struct anonymous") 94 public anonymous basics$get(); 95 public void basics$set(anonymous arg); 96 public Pointer<anonymous> basics$ptr(); 97 98 @NativeLocation(file = "simple.h", line = 20, column = 8, USR = "c:@S@_unsigned") 99 @NativeStruct("[BOSILQ]") 100 @NativeType(layout="[BOSILQ]", ctype = "struct _unsigned") 101 public static interface _unsigned extends Struct<_unsigned> { 102 @NativeLocation(file="simple.h", line=21, column=11, USR="") 103 @NativeType(name="b", layout="B", ctype = "_Bool") 104 @Offset(offset = 0) 105 public boolean b$get(); 106 public void b$set(boolean arg); 107 public Pointer<Boolean> b$ptr(); 108 109 @NativeLocation(file="simple.h", line=22, column=19, USR="") 110 @NativeType(name="ch", layout="O", ctype = "unsigned char") 111 @Offset(offset = 8) 112 public byte ch$get(); 113 public void ch$set(byte c); 114 public Pointer<Byte> ch$ptr(); 115 116 @NativeLocation(file="simple.h", line=23, column=20, USR="") 117 @NativeType(name="s", layout="S", ctype = "unsigned short") 118 @Offset(offset = 16) 119 public short s$get(); 120 public void s$set(short s); 121 public Pointer<Short> s$ptr(); 122 123 @NativeLocation(file="simple.h", line=24, column=18, USR="") 124 @NativeType(name="n", layout="I", ctype = "unsigned int") 125 @Offset(offset = 32) 126 public int n$get(); 127 public void n$set(int i); 128 public Pointer<Integer> n$ptr(); 129 130 @NativeLocation(file="simple.h", line=25, column=19, USR="") 131 @NativeType(name="l", layout="L", ctype = "unsigned long") 132 @Offset(offset = 64) 133 public long l$get(); 134 public void l$set(long l); 135 public Pointer<Long> l$ptr(); 136 137 @NativeLocation(file="simple.h", line=26, column=24, USR="") 138 @NativeType(name="ll", layout="Q", ctype = "unsigned long long") 139 @Offset(offset = 128) 140 public long ll$get(); 141 public void ll$set(long l); 142 public Pointer<Long> ll$ptr(); 143 } 144 145 @NativeLocation(file="simple.h", line=27, column=4, USR="") 146 @NativeType(name="unsigned_int", layout="p:[BOSILQ]", ctype="struct _unsigned *") 147 public Pointer<_unsigned> unsigned_int$get(); 148 public void unsigned_int$set(Pointer<_unsigned> arg); 149 public Pointer<Pointer<_unsigned>> unsigned_int$ptr(); 150 151 @NativeLocation(file = "simple.h", line = 29, column = 6, USR = "c:@F@func") 152 @NativeType(name="func", layout="([cosilqFDE]p:c)V", ctype = "void (struct anonymous, char *)") 153 public void func(anonymous s, Pointer<Byte> str); 154 } --- EOF ---