Skip to content
animehunter edited this page Apr 23, 2014 · 9 revisions

Functions

Names

  • All spaces replaced with underscores
  • Lowercase
  • Functions that belong to a group <name> should be named <name>_something(...)
  • Argument list should be expanded to multiple lines, if line length is obviously getting too wide.
  • Getter functions should ideally be named <prefix>_get_<variable>() or <prefix>_<variable>()
  • Setter functions should ideally be named <prefix>_set_<variable>()

Return values

  • Functions that check if something IS something (eg. object_is_airborne), should return int 0 or 1 for boolean value
  • Functions that DO something with given arguments, should return 0 for success, and > 0 for failure code

Headers

  • Include system headers before library ones
  • Include library headers before local ones

Identifiers

  • Variables, functions, types and goto labels may only use lowercase letters
  • Constants, enumerators and macros may only use UPPERCASE letters