manpagez: man pages & more
info libffi
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3.2 Structures

Although ‘libffi’ has no special support for unions or bit-fields, it is perfectly happy passing structures back and forth. You must first describe the structure to ‘libffi’ by creating a new ffi_type object for it.

Data type: ffi_type

The ffi_type has the following members:

size_t size

This is set by libffi; you should initialize it to zero.

unsigned short alignment

This is set by libffi; you should initialize it to zero.

unsigned short type

For a structure, this should be set to FFI_TYPE_STRUCT.

ffi_type **elements

This is a ‘NULL’-terminated array of pointers to ffi_type objects. There is one element per field of the struct.


This document was generated on March 29, 2013 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.