7 - Data types
The data types, the syntax and the semantic are the ones of ANSI C and C++ languages. In order to ease readibility in the rest of the document, the expression 'C code' implicitly means 'ANSI C and C++ code'. There is no SDL-RT predefined data types at all but just some keywords that should not be used in the C code. Considering the SDL-RT architecture and concepts surrounding the C code some important aspects need to be described.
7.1 - Type definitions and headers
Types are declared in the text symbol:
Types declared in an agent are only visible in the architecture below the agent.
7.2 - Variables
Variables are declared after the type definitions in the same text symbol.
Variables declared in an agent are only visible in the architecture below the agent. For example global variables are to be declared at system level. A variable declared in a block level is not seen by an upper level block. Variables declared in an SDL-RT process in a text symbol are local to the process. They can not be seen or manipulated by any other process.
7.3 - C functions
SDL-RT internal C functions are to be defined through the SDL-RT procedure symbol. An SDL-RT procedure can be defined graphically in SDL-RT or textually in C. When defined in C the procedure call symbol should not be used. A standard C statement in an action symbol should be used.
7.4 - External functions
External C functions can be called from the SDL-RT system. These should be prototyped in the system or in an external C header. It is up to an SDL-RT tool to gather the right files when compiling and linking.