wiki:Developer/Coding/NamingRules

Version 5 (modified by Gedare, on 05/30/14 at 18:14:34) (diff)

Naming rules

General rules

  • Avoid abbreviations. Exceptions are for well-known acronyms.
  • Use descriptive language.
  • File names should be lower-case alphabet letters only, plus the extension.
  • Local-scope variable names are all lower case with underscores between words.
  • Constants are all capital letters with underscores between words.
  • Type names, function names, and global scope names have different rules depending on whether they are part of the public API or are internal to RTEMS, see below.

User-facing API

The public API routines follow a standard API like POSIX or *BSD or start with rtems_. If a name starts with rtems_, then it should be assumed to be available for use by the application and be documented in the User's Guide.

Classic API

  • TODO.

SuperCore? Naming

SuperCore? is organized in an Object-Oriented fashion. Each score Manager is a Package, or Module, and each Module contains type definitions, functions, etc. The following summarizes our conventions for using names within SuperCore? Modules.

  • Use "Module_name_Particular_type_name" for type names.
  • Use "_Module_name_Particular_function_name" for functions names.
  • Use "_Module_name_Global_or_file_scope_variable_name" for global or file scope variable names.

Within a structure,

  • Use "Name" for struct aggregate members.
  • Use "name" for reference members.
  • Use "name" for primitive type members.

Example

typedef struct {
  Other_module_Struct_type    Aggregate_member_name;
  Other_module_Struct_type   *reference_member_name;
  Other_module_Primitive_type primitive_member_name;
} The_module_Type_name;