-
Notifications
You must be signed in to change notification settings - Fork 6
/
NAMING
46 lines (32 loc) · 1.1 KB
/
NAMING
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
NAMING CONVENTION
All default names must be in snake_case (with SCREAMING_SNAKE_CASE for macros,
defines and constants), unless otherwise specified.
Semantic:
g###_* - user routines
ig###_* - internal routines
zg###_* - implementation-related routines
zz_* - symbols not intended for users in any way (e.g. include guards)
*_IG - include guard
Part marked as ### should be "ena" to get "gena" in library-wide routines, or
a shortened name of the data structure otherwise. Shortened names must have
from 3 to 5 characters and start with a consonant letter.
Function Arguments:
p* - handle passed by pointer
OUT_* - pointer to an output value
Macro Arguments:
ptr_* - argument should be either a pointer variable or a pointer constant
tp* - template parameter (rest must be in CamelCase, e.g. tpTypeInfo)
Variables and Constants:
const_* - 'static' constant value
func_* - functional variable
Types:
*** - type alias
*_e - enum
*_s - struct
*_u - union
*_p - pointer
*_f - functional type
*_x - opaque type
*_h - handle type
*_o - object type
*_z - any other user-defined type