Contents of C/C++ source files
The following table describes how to name the C/C++ item that is in a C or C++ source file; these are the actual contents, not the external source file name. These conventions are in place to avoid clashing with namespaces of customers if a header is included in and compiled with customer source code.
Item in C/C++ source file | z/TPF - interface protected (interface guaranteed) | z/TPF - implementation specific (interface not guaranteed) | BAL equivalent exists |
---|---|---|---|
identifiers
macro (#define) typedef enumeration
tags³
exported
|
One of the following¹:
|
Anything | One of the following:²
|
Table notes:
- TO2_ functions are exceptions to this naming convention. They will not be renamed.
- All existing z/TPF DSECTs will not be renamed and are exceptions.
- Global tags and system equates migrated from Assembler to C language:
- Use an underscore character followed by the name in lowercase when naming global variables. For example, global assembler tag @globz would be _globz in C. Except for the underscore (_) substitution, names should follow the existing assembler standard.
- Use uppercase characters when naming constants. Replace the # at the start
of some system constants with an underscore character (_). Comment on the
use or purpose of all constant values.
The following assembler system equates #SYSEQ EQU 12 maximum number of jobs allowed in system WIGITCNT EQU 42 number of wigits supported become, in C #define _SYSEQ 12 /* maximum number of jobs allowed in system */ #define WIGITCNT 42 /* number of wigits supported */
- If a C or C++ header is created for an existing BAL DSECT, prefix the C or C++ structure name with TPF_ or tpf_. If there is an existing BAL DSECT, member names in the C or C++ structure are the same as in the corresponding BAL DSECT.
- See Exported symbol names for C shared objects (CSOs) that are used by applications and Generally reserved names for the z/TPF system for more information about naming standards when you are creating (or porting and changing) a new C/C++ function.