1.11.3. Naming conventions and identifier

  1. The names of all components have to begin always with Cmp, e.g.:
    CmpApp for the application component. The system components have to begin always with Sys and the IO driver always with IoDrv.
  2. Function names in component interfaces should always have a component prefix attached to make sure they are unique.
    The prefix should be as short as possible (ideally 3 or 4 characters), e.g.:
    AppCreate(); /* Create component function CmpApp */
  3. Customer-specific components should always have the company name attached, e.g.:
    CmpApp3S (3S specific components which replace the standard CmpApp component)
    or:
    Cmp3S (3S specific components, which is loaded as an extension of the runtime system)
  4. Names of functions, variables and structures in camel case:

    • Functions begin with upper case letters

    • Variables with lower case letters

    • Structures begin with upper case letters

    Note

    External library functions are always written in lower case, to distinguish them from C functions, which usually have the same name!

  5. Macros are always written in upper case letters, e.g.
    #define MAX_APPLICATIONS 10
    The pre-processor instructions must also have to be written in upper case letters.
    (Note: Constants with variables in camel case, e.g. const RTS_UI32 ui32MaxApplications = 10; )
  6. Use always the so called “Systems Hungarian notation” in variables (see next chapter).