You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -15,7 +16,7 @@ The Dinosaur Planet decompilation style guide.
15
16
16
17
## Naming
17
18
18
-
### Global Functions (core code)
19
+
### Functions (core code)
19
20
20
21
`camelCase` with a prefix. The prefix should be short and identify the subsystem/file.
21
22
@@ -24,34 +25,34 @@ Examples:
24
25
-`texLoadTexture`
25
26
-`mainGetBits`
26
27
27
-
Official function names and prefixes should be used where possible. These will be in the same style. If an official name is particularly confusing, a custom name may be used instead.
28
+
Official function names and prefixes should be used where possible. For global functions these will be in the same style. If an official name is particularly confusing, a custom name may be used instead.
29
+
30
+
Note that **static** functions should also start with a prefix, **except** for:
31
+
- Library code (use the official function names regardless of format).
32
+
- Functions where the official name is known (if the official name is not particularly unique, a custom prefixed name may be used instead.)
28
33
29
-
### Global Functions (DLL code)
34
+
### Functions (DLL code)
30
35
31
-
Exports:
32
-
`<prefix>[_subPrefix]_<FuncName>` where:
33
-
-`prefix` - A (generally) `camelCase` prefix that represents the name of the DLL (this is similar to core code global functions). Example: `amSfx`.
-`prefix` - A prefix that represents the name of the DLL (this is similar to core code global functions). Example: `amSfx`. May be `PascalCase`.
34
38
-`_subPrefix`- For exports that implement a nested interface (i.e. a more generic interface not specific to that DLL), the sub prefix is a `camelCase` prefix identifying that interface. Examples: `_obj`, `_vehicle`.
35
39
-`FuncName` - The rest of the function name in `PascalCase`.
**Constructors/destructors:**`<prefix>_<ctor or dtor>`.
43
46
-`prefix` - The same prefix used by exports.
44
47
- Examples: `amSfx_ctor`, `amSfx_dtor`.
45
48
46
-
Global DLL functions are special as they represent DLL constructors, destructors, and exports. Export functions implement a DLL interface and as such the name of the interface should be included in the function name. In cases where an export implements a nested interface, an identifier for that interface is also included.
47
-
48
-
Official function names should be adapted to this format where possible. For example: `amSfxPlay` (official) -> `amSfx_Play`.
49
-
50
-
### Static Functions
49
+
**Statics:**`<prefix>_<funcName>` where:
50
+
-`prefix` - The same prefix used by exports.
51
+
-`funcName` - The rest of the function name in `camelCase`. Note that static functions start this segment with a lowercase character and global (export) functions start with an uppercase character.
51
52
52
-
`camelCase`*without* a prefix. Avoid starting the name with a word that may collide with the prefix of global functions (e.g. don't start a static function name with `obj`).
53
+
Global DLL functions are special as they represent DLL constructors, destructors, and exports. Export functions implement a DLL interface and as such the naming convention states which interface is being implemented when relevant (i.e. when not a DLL's own interface).
53
54
54
-
Note that for core code, it is generally not recommended to mark functions as static even if the function logically should be static. In those cases, the global function naming style should be preferred, unless the official function name is known.
55
+
Official function names should be adapted to this format where possible. For example: `amSfxPlay` (official, export) -> `amSfx_Play`.
0 commit comments