Mapping table
IDL types are mapped to C types when they are compiled by the toolchain. The table below presents the mappings for each primitive type
IDL type | "in" mapping (default) | "out" / "in out" mapping | return mapping |
void | void | void | void |
boolean | unsigned char | unsigned char * | unsigned char |
char | unsigned short | unsigned short * | unsigned short |
byte | signed char | signed char * | signed char |
short | signed short | signed short * | signed short |
int | signed int | signed int * | signed int |
long | signed long long | signed long long * | signed long long |
unsigned byte | unsigned char | unsigned char * | unsigned char |
unsigned short | unsigned short | unsigned short * | unsigned short |
unsigned int | unsigned int | unsigned int * | unsigned int |
unsigned long | unsigned long long | unsigned long long * | unsigned long long |
float | float | float * | float |
double | double | double * | double |
string | char * | char ** | char * |
any | void * | void ** | void * |
Identifier | FullyQualifiedCIdentifier (see note) | FullyQualifiedCIdentifier * (see note) | FullyQualifiedCIdentifier (see note) |
C99 types from stdint.h: int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, int_least8_t, int_least16_t, int_least32_t, int_least64_t, uint_least8_t, uint_least16_t, uint_least32_t, uint_least64_t, int_fast8_t, int_fast16_t, int_fast32_t, int_fast64_t, uint_fast8_t, uint_fast16_t, uint_fast32_t, uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t |
type | type * | type |
size_t | size_t | size_t * | size_t |
ptrdiff_t | ptrdiff_t | ptrdiff_t * | ptrdiff_t |
wchar_t | wchar_t | wchar_t * | wchar_t |
Note:
Where a C identifier is generated for Cecilia IDL complex types (Interfaces, Records, Enums). The identifier is generated respected to the rule below:
( Identifier ( "." Identifier)* ) => ( Identifier ( "_" Identifier)* )
So for instance the video.api.Printer IDL type would be mapped to a C counterpart as video_api_Printer.
Primitive types shortcuts
Some primitive types have a shortcut alias.
C type | shortcut |
unsigned char | jboolean |
unsigned short | jchar |
signed char | jbyte |
signed short | jshort |
signed int | jint |
signed long long | jlong |
unsigned char | jubyte |
unsigned short | jushort |
unsigned int | juint |
unsigned long long | julong |
float | jfloat |
double | jdouble |
Mapping of pointer and arrays
In C arrays are handled by reference. It means that when two components exchange an array through an interface with a method like
void foo(in int[10] param)
they actually exchange a reference to an array. This implies that the called component may modify the content of the array even if the parameter is not declared in out. Declaring an array parameter with the in out keywords means that the called component may return a different array reference than the one it receives.
IDL parameter | C parameter |
in int[10] param | int param[10] |
out int[10] param | int (*param)[10] |
in int *[10] param | int* param[10] |
out int *[10] param | int* (*param)[10] |
in MyRecord[10] param | MyRecord param[10] |
out MyRecord[10] param | RMyRecord (*param)[10] |