Defining interfaces

C modules may also define interfaces. An interface definition starts with the macro A_INTERFACE, and ends with A_END_INTERFACE(). The contents of the interface, including its members and superinterface (if any), are defined within these macros using the same macros that are used for defining classes. These macros are described in the previous section.

In particular, the following macros (and their different variants) can be used within interfaces:

When using macros A_METHOD, A_GETTER or A_SETTER, replace the implementation function pointer with NULL, since there is no implementation. Example:

A_INTERFACE("Example")
    A_GETTER("a", 0, NULL)
A_END_INTERFACE()
A_INTERFACE(name)
Define a C interface with the given name. The definition of the interface follows this macro, and is terminated with the A_END_INTERFACE macro. Interface definitions cannot be nested.
A_END_INTERFACE()
Mark the end of an interface definition.