Resources | Resources |



Output generation

C header files

The qidl compiler generates C headers that resemble hand-written headers. For each interface name in the IDL file, an INHERIT_name macro is generated, followed by a call to the AEEINTERFACE_DEFINE macro to define the interface. Static inline accessors are also generated for each method.

C stub and skeleton files

The C stubs and skels generated for each interface use the CStub and CSkel framework. Stubs and skels for derived interfaces re-use code from base interfaces to reduce the amount of code generated. Therefore, if IDerived inherits from IBase, the stub and skel for IDerived will need to be linked with the stub and skel for IBase.

The code generator generates C stub and skeleton code in two separate files, one for the stub, and one for the skeleton. The functions to instantiate the stub and skel for a given interface are named after the interface, with Stub_New and Skel_New appended.

For example, the generated files and exported functions for a file IFoo.idl that contains the interface IFoo are shown in the following table:

File Description Exported Function
IFoo.h Interface header for IFoo N/A
IFoo_stub.h Stub header for IFoo IFooStub_New
IFoo_stub.c Stub implementation for IFoo
IFoo_skel.h Skel header for IFoo IFooSkel_New
IFoo_skel.c Skel implementation for IFoo

C++ header file

The qidl compiler generates C++ headers that are similar to the source IDL, since C++ has native support for namespaces and classes.

Because the C and C++ mappings are designed to be binary compatible, there is no need to generate C++ stubs and skels in addition to the C stubs and skels. However, this means that C++-only header generation is not possible when remoting is required, since the C stubs and skels require the C header. Consequently, the -mc++ (C++-only) option is only permitted if remoting code generation is also disabled (-ho). When both C++ and remoting is desired, use the default -mcxx mapping option to generate a header that works for both C and C++.