Skip to main content

The generatedDefinition definition

note

Work in progress.

Purpose

Specify the name of the header variable to be generated.

Syntax

{
"cdlOptions": {
"<name>": {
...
"generatedDefinition": "<string>",
...
}
}
}

The value of the generatedDefinition property is a string containing a C/C++ preprocessor identifier.

Default value

If missing, no header definition is generated for this object.

Description

In order for a header definition to be generated, the full path of the include file where it will be added and the name of the preprocessor symbol are needed. The file name is provided by generatedFile and the preprocessor symbol by generatedDefinition.

The name must be a valid C/C++ preprocessor identifier: a sequence of uppercase or lowercase letters, digits, and underscores, starting with a non-digit character. Identifiers beginning with an underscore should normally be avoided because they may clash with system packages or identifiers reserved for use by the compiler.

Within a file, names must be unique. For a recommended naming convention, see the section called Package Contents and Layout in xCDL packages.

For active and enabled objects, if the generatedDefinition property is defined, a line with the following structure will be generated in the file pointed by the generatedFile property:

#define <name> <value>

For nodes of type none, the default definition includes only the name:

#define <name>

For objects with type string, a second line will be generated, with the value appended to the name.

#define <name>_<value>

The value is slightly adjusted to uppercase and all non-letter characters are changed with _. Empty strings are suffixed with _EMPTY.

Example

TBD

eCos reference

  • none