17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package com.acme;
27
28 import java.foreign.annotations.NativeAddressof;
29 import java.foreign.annotations.NativeGetter;
30 import java.foreign.annotations.NativeHeader;
31 import java.foreign.annotations.NativeSetter;
32 import java.foreign.annotations.NativeStruct;
33 import java.foreign.memory.Pointer;
34 import java.foreign.memory.Struct;
35
36 @NativeHeader(path="bitfields.h")
37 public interface bitfields { // platform dependent
38
39 /*
40 class bitfields1 size(24):
41 +---
42 0. | x (bitstart=0,nbits=2)
43 8. | y (bitstart=0,nbits=15)
44 16. | z (bitstart=0,nbits=20)
45 20. | w (bitstart=0,nbits=13)
46 +---
47 */
48
49
50 @NativeStruct("[" +
51 "u64=[" +
52 "i2(x)" +
53 "x62]" +
54 "u64=[" +
55 "i15(y)" +
56 "x49]" +
57 "u64=[" +
306 public interface bitfields9 extends Struct<bitfields9> {
307 @NativeGetter("x")
308 int x$get();
309 @NativeSetter("x")
310 void x$set(int var1);
311
312 @NativeGetter("y")
313 int y$get();
314 @NativeSetter("y")
315 void y$set(int var1);
316
317 @NativeGetter("z")
318 int z$get();
319 @NativeSetter("z")
320 void z$set(int var1);
321 @NativeAddressof("z")
322 Pointer<Integer> z$ptr();
323 }
324
325 @NativeStruct("[u32=[u1(x)]|x64](bitfields10)")
326 public interface bitfields10 extends Struct<bitfields.bitfields10> {
327 @NativeGetter("x")
328 int x$get();
329
330 @NativeSetter("x")
331 void x$set(int var1);
332 }
333
334 }
|
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package com.acme;
27
28 import java.foreign.annotations.NativeAddressof;
29 import java.foreign.annotations.NativeGetter;
30 import java.foreign.annotations.NativeHeader;
31 import java.foreign.annotations.NativeSetter;
32 import java.foreign.annotations.NativeStruct;
33 import java.foreign.memory.Pointer;
34 import java.foreign.memory.Struct;
35
36 @NativeHeader(path="bitfields.h")
37 public interface bitfields_h { // platform dependent
38
39 /*
40 class bitfields1 size(24):
41 +---
42 0. | x (bitstart=0,nbits=2)
43 8. | y (bitstart=0,nbits=15)
44 16. | z (bitstart=0,nbits=20)
45 20. | w (bitstart=0,nbits=13)
46 +---
47 */
48
49
50 @NativeStruct("[" +
51 "u64=[" +
52 "i2(x)" +
53 "x62]" +
54 "u64=[" +
55 "i15(y)" +
56 "x49]" +
57 "u64=[" +
306 public interface bitfields9 extends Struct<bitfields9> {
307 @NativeGetter("x")
308 int x$get();
309 @NativeSetter("x")
310 void x$set(int var1);
311
312 @NativeGetter("y")
313 int y$get();
314 @NativeSetter("y")
315 void y$set(int var1);
316
317 @NativeGetter("z")
318 int z$get();
319 @NativeSetter("z")
320 void z$set(int var1);
321 @NativeAddressof("z")
322 Pointer<Integer> z$ptr();
323 }
324
325 @NativeStruct("[u32=[u1(x)]|x64](bitfields10)")
326 public interface bitfields10 extends Struct<bitfields10> {
327 @NativeGetter("x")
328 int x$get();
329
330 @NativeSetter("x")
331 void x$set(int var1);
332 }
333
334 }
|