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