Next: The pointer form, Up: Basic C Types and Functions [Contents][Index]
The following assortment lists all predefined C data types. These types are also known as Basic FFI types. We assume these to be well known and do not explain them further.
byte
, unsigned byte
char
, unsigned-char
short
, unsigned-short
int
, unsigned-int
long
, unsigned-long
float
,
double
void
c-string
c-data
As with C data types, the actual meaning of these types depends on the system architecture, but there is no difference between these FFI predefined types and their C-pendant if FFI is run on the same machine.
However, the last two types in the list are special in that they are
actually a (pointer char)
(in C known as ‘char*’), but (as
the name suggests) data of this type form a string on C level, or
arbitrary chunks of (bytewise-oriented) data which is translated to or
translated from an ordinary emacs string. In constrast, we should
mention that the ‘char*’ is actually solely a pointer to one
character, and not a string a priori.
In order to handle arbitrary binary data blocks, the type
c-data
can be used in conjunction with a size parameter (see
The c-data
form). Strings – the internal representation
of data of this type – are (re-)encoded to binary
(i.e. the
generic binary coding system) due to Mule issues.