Remote Administration Daemon Developer Guide

Exit Print View

Updated: July 2014
 
 

Running radadrgen

radadrgen is instructed to produce definitions for C/libadr consumers by using its -c option, as shown in the following example.

Example 5-5  Invoking radadrgen
$ radadrgen -l c -s server -d output_dir example.adr

The -c option produces two files, api_APINAME.h and api_APINAME_impl.c in the output_dir, where APINAME is derived from the name attribute of the API document's api element. api_APINAME_impl.c contains the implementation of the interfaces and data types defined by the API. It should be compiled and linked with the software needing those definitions.

api_APINAME.h externs the specific symbols defined by api_APINAME_impl.c that consumers will need to reference, and should be included by those consumers. api_APINAME.h contains no data definitions itself and may be included in as many places as necessary. Neither file should be modified.

For each derived type TYPE, whether enumeration or structure, defined in the API, an adr_type_t named t__TYPE (two underscores) representing that type is generated and externed by the header file. If an array of that type is used anywhere in the API, an adr_type_t named t_array__TYPE (one underscore, two underscores) representing that array type is generated and externed. For each interface INTERFACE defined in the file, an adr_object_t named interface_INTERFACE is defined and externed.

For each value VALUE of an enumeration named TYPE , an adr_data_t named e__TYPE_VALUE is defined and externed. These adr_data_t values are marked as constants and are not affected by adr_data_ref or adr_data_free.