diff options
Diffstat (limited to 'docs/source/techspecs')
-rw-r--r-- | docs/source/techspecs/index.rst | 30 | ||||
-rw-r--r-- | docs/source/techspecs/naming.rst | 59 |
2 files changed, 19 insertions, 70 deletions
diff --git a/docs/source/techspecs/index.rst b/docs/source/techspecs/index.rst index 40d4048e522..45fe45a6121 100644 --- a/docs/source/techspecs/index.rst +++ b/docs/source/techspecs/index.rst @@ -5,19 +5,19 @@ This section covers technical specifications useful to programmers working on MAME’s source or working on scripts that run within the MAME framework. .. toctree:: - :titlesonly: + :titlesonly: - naming - layout_files - layout_script - object_finders - device_memory_interface - device_rom_interface - device_disasm_interface - memory - floppy - nscsi - luaengine - luareference - m6502 - poly_manager + naming + layout_files + layout_script + object_finders + device_memory_interface + device_rom_interface + device_disasm_interface + memory + floppy + nscsi + luaengine + luareference + m6502 + poly_manager diff --git a/docs/source/techspecs/naming.rst b/docs/source/techspecs/naming.rst index 94d3a889649..b91e5ba9d93 100644 --- a/docs/source/techspecs/naming.rst +++ b/docs/source/techspecs/naming.rst @@ -1,3 +1,5 @@ +.. _naming: + MAME Naming Conventions ======================= @@ -13,25 +15,6 @@ To promote consistency and readability in MAME source code, we have some naming conventions for various elements. -.. _naming-definitions: - -Definitions ------------ - -Snake case - All lowercase letters with words separated by underscores: - ``this_is_snake_case`` -Screaming snake case - All uppercase letters with words separated by underscores: - ``SCREAMING_SNAKE_CASE`` -Camel case: - Lowercase initial letter, first letter of each subsequent word - capitalised, with no separators between words: ``exampleCamelCase`` -Llama case: - Uppercase initial letter, first letter of each subsequent word - capitalised, with no separators between words: ``LlamaCaseSample`` - - .. _naming-transliteration: Transliteration @@ -108,39 +91,5 @@ use lowercase for anything else besides proper nouns and initialisms. C++ naming conventions ---------------------- -Preprocessor macros - Macro names should use screaming snake case. Macros are always - global and name conflicts can cause confusing errors – think - carefully about what macros really need to be in headers and name - them carefully. -Include guards - Include guard macros should begin with ``MAME_``, and end with a - capitalised version of the file name, withe separators replaced by - underscores. -Constants - Constants should use screaming snake case, whether they are constant - globals, constant data members, enumerators or preprocessor - constants. -Functions - Free functions names should use snake case. (There are some utility - function that were previously implemented as preprocessor macros - that still use screaming snake case.) -Classes - Class names should use snake case. Abstract class names should end - in ``_base``. Public member functions (including static member - functions) should use snake case. -Device classes - Concrete driver ``driver_device`` implementation names - conventionally end in ``_state``, while other concrete device class - names end in ``_device``. Concrete ``device_interface`` names - conventionally begin with ``device_`` and end with ``_interface``. -Device types - Device types should use screaming snake case. Remember that device - types are names in the global namespace, so choose explicit, - unambiguous names. -Enumerations - The enumeration name should use snake case. The enumerators should - use screaming snake case. -Template parameters - Template parameters should use llama case (both type and value - parameters). +For C++ naming conventions, see the relevant section in the C++ +Coding Guidelines: :ref:`contributing-cxx-naming` |