Nitro SDK functions can be classified into categories according to their application and they have been given names that help make this clear.
[A-Z][A-Z0-9]+
OS | Items related to the OS system. |
---|---|
G2,G3,GX... | Items related to graphics. (Numerals are also included.) |
MI | Items related to memory exchange such as DMA. |
SVC | Items related to system calls. |
(03/11/13)
Note: The distinction in the main processor and subprocessor categories was eliminated and all caps are used uniformly.
(04/01/18)
Functions are named as follows: Subject and object connected without an underscore with the first letter of each separate word capitalized.
Example: OS_SetInterruptMask, OS_IsLocked
Example: OSi_SetInterruptMaskBase
However, there are some functions that do not traditionally follow this rule, such as OS_InterruptHandler
.
(03/11/13)
There are two methods available for deciding the name of a function that generates and/or initializes objects. One is Create
and the other is Init
. In this case, Create
is used when a function for explicitely destroying the object must be called, while Init
is used when disposal processing is not required.
(03/12/15)
Functions and types are the same since the name used in typedefs fundamentally adhere to GAMECUBE conventions. Note that a verb is not used after the category name.
Example: OSInterruptCallback
Example: OSCopyMode
As an exception, names such as OSCopyMode
given above are included for functions used to control the operations of the API itself. In this case, the function is likely to control the operations of a function having a name like GXCopy
. Names such as GXCopyStatus
and GXCopyType
are also conceivable for a function like this. Although this is recognized as a natural way to name such functions, do not take this concept too far.
(03/11/13)
Constants defined by enum
, define
, and const
will have the format shown below.
Example: OS_INTERRUPT_MAX, OS_INTERRUPT_MAX
(04/01/18)